aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-07 09:07:32 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-07 09:07:32 -0800
commitcb1a785b132482fc92ac65706119f6bf81fe6432 (patch)
treebb881656b8eb6bf38cd343f0e69472aeceff5b83
parentf137ae9fc2745be3d15badb017a1c0030937dff2 (diff)
optimize guard_acquire and guard_release and note that llvm violates SAFE_HEAP when using it
-rw-r--r--src/library.js11
-rw-r--r--tests/runner.py1
2 files changed, 8 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index 03dc5cbd..0504882c 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4203,11 +4203,14 @@ LibraryManager.library = {
},
__cxa_guard_acquire: function(variable) {
- return !{{{ makeGetValue(0, 'variable', 'i8') }}}
- },
- __cxa_guard_release: function(variable) {
- {{{ makeSetValue(0, 'variable', '1', 'i8') }}}
+ if (!{{{ makeGetValue(0, 'variable', 'i8', null, null, 1) }}}) { // ignore SAFE_HEAP stuff because llvm mixes i64 and i8 here
+ {{{ makeSetValue(0, 'variable', '1', 'i8') }}};
+ return 1;
+ }
+ return 0;
},
+ __cxa_guard_release: function() {},
+ __cxa_guard_abort: function() {},
_ZTVN10__cxxabiv117__class_type_infoE: [1], // no inherited classes
_ZTVN10__cxxabiv120__si_class_type_infoE: [2], // yes inherited classes
diff --git a/tests/runner.py b/tests/runner.py
index ca3fe473..86d37e8e 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3869,6 +3869,7 @@ def process(filename):
''', 'hello world', includes=[path_from_root('tests', 'libcxx', 'include')]);
def test_static_variable(self):
+ Settings.SAFE_HEAP = 0 # LLVM mixes i64 and i8 in the guard check
src = '''
#include <stdio.h>