aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-01 12:45:46 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-03-01 12:45:46 -0500
commitec2a9d6326c3c7f34bc2830a9f3f99face7df4bc (patch)
tree6fc4716f7468039dff3653c41acc161c920b54bf /src
parentf4c9cea88197070a7b1e5b9e480e1c32354aab7b (diff)
make intentional faults work in asm
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 3483b8b1..53d23140 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -914,7 +914,11 @@ function JSify(data, functionsOnly, givenFunctions) {
case VAR_NATIVIZED:
if (isNumber(item.ident)) {
// Direct write to a memory address; this may be an intentional segfault, if not, it is a bug in the source
- return 'throw "fault on write to ' + item.ident + '";';
+ if (ASM_JS) {
+ return 'abort(' + item.ident + ')';
+ } else {
+ return 'throw "fault on write to ' + item.ident + '";';
+ }
}
return item.ident + '=' + value + ';'; // We have the actual value here
break;