aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/preamble.js7
-rw-r--r--tests/test_core.py3
-rw-r--r--tests/test_sanity.py2
-rw-r--r--tools/shared.py2
4 files changed, 10 insertions, 4 deletions
diff --git a/src/preamble.js b/src/preamble.js
index f46119c7..e0ed8786 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -352,6 +352,13 @@ var cwrap, ccall;
// C calling interface. A convenient way to call C functions (in C files, or
// defined with extern "C").
//
+ // Note: ccall/cwrap use the C stack for temporary values. If you pass a string
+ // then it is only alive until the call is complete. If the code being
+ // called saves the pointer to be used later, it may point to invalid
+ // data. If you need a string to live forever, you can create it (and
+ // must later delete it manually!) using malloc and writeStringToMemory,
+ // for example.
+ //
// Note: LLVM optimizations can inline and remove functions, after which you will not be
// able to call them. Closure can also do so. To avoid that, add your function to
// the exports using something like
diff --git a/tests/test_core.py b/tests/test_core.py
index 7c317894..7b8916da 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4664,8 +4664,7 @@ int main(void) {
if self.emcc_args is None: self.emcc_args = [] # dlmalloc auto-inclusion is only done if we use emcc
self.banned_js_engines = [NODE_JS] # slower, and fail on 64-bit
- Settings.CORRECT_SIGNS = 2
- Settings.CORRECT_SIGNS_LINES = ['src.cpp:' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
+ Settings.CORRECT_SIGNS = 1
Settings.TOTAL_MEMORY = 128*1024*1024 # needed with typed arrays
src = open(path_from_root('system', 'lib', 'dlmalloc.c'), 'r').read() + '\n\n\n' + open(path_from_root('tests', 'dlmalloc_test.c'), 'r').read()
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index 3d3da523..3ebd49b6 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -240,7 +240,7 @@ class sanity(RunnerCore):
os.chmod(path_from_root('tests', 'fake', 'bin', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
os.chmod(path_from_root('tests', 'fake', 'bin', 'clang++'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
try_delete(SANITY_FILE)
- output = self.check_working(EMCC, 'did not see a source tree above LLVM_DIR, could not verify version numbers match')
+ output = self.check_working(EMCC, 'did not see a source tree above the LLVM root directory')
VERSION_WARNING = 'Emscripten, llvm and clang versions do not match, this is dangerous'
diff --git a/tools/shared.py b/tools/shared.py
index 3ce23a4c..7aaa4136 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -326,7 +326,7 @@ def check_fastcomp():
break
d = os.path.dirname(d)
if not seen:
- logging.warning('did not see a source tree above LLVM_DIR, could not verify version numbers match')
+ logging.warning('did not see a source tree above the LLVM root directory (guessing based on directory of %s), could not verify version numbers match' % LLVM_COMPILER)
return True
except Exception, e:
logging.warning('could not check fastcomp: %s' % str(e))