aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-01 13:31:13 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-03-01 13:31:13 -0500
commitdbac2b2beee684a56642608f8e93f9eabf765bcf (patch)
treeba6b8d630ce5a7fd31a6c0c6de693dd407f62a22 /src
parentec2a9d6326c3c7f34bc2830a9f3f99face7df4bc (diff)
abort on loads from absolute addresses, just like saves
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 53d23140..7066f8c5 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1226,6 +1226,15 @@ function JSify(data, functionsOnly, givenFunctions) {
var impl = item.ident ? getVarImpl(item.funcData, item.ident) : VAR_EMULATED;
switch (impl) {
case VAR_NATIVIZED: {
+ if (isNumber(item.ident)) {
+ item.assignTo = null;
+ // Direct read from a memory address; this may be an intentional segfault, if not, it is a bug in the source
+ if (ASM_JS) {
+ return 'abort(' + item.ident + ')';
+ } else {
+ return 'throw "fault on read from ' + item.ident + '";';
+ }
+ }
return value; // We have the actual value here
}
case VAR_EMULATED: return makeGetValue(value, 0, item.type, 0, item.unsigned, 0, item.align);