diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 2 | ||||
-rw-r--r-- | src/jsifier.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index d9db10f9..6b91f527 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -74,7 +74,7 @@ function intertyper(data, sidePass, baseLineNums) { var global = /([@%\w\d\.\" $-]+) = .*/.exec(line); var globalIdent = toNiceIdent(global[1]); var testAlias = /[@%\w\d\.\" $-]+ = alias .*/.exec(line); - var testString = /^[^"]+c\"[^"]+"/.exec(line); + var testString = /[@%\w\d\.\" $-]+ = [\w ]+ \[\d+ x i8] c".*/.exec(line); Variables.globals[globalIdent] = { name: globalIdent, alias: !!testAlias, diff --git a/src/jsifier.js b/src/jsifier.js index b3c2af1d..1d18f292 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -765,6 +765,10 @@ function JSify(data, functionsOnly, givenFunctions) { } switch (impl) { 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 + '";'; + } return item.ident + '=' + value + ';'; // We have the actual value here break; case VAR_EMULATED: |