aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-06 10:54:10 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-06 11:05:05 -0700
commit0ff7f8dcd655e84eb7c750cff927b11231b61589 (patch)
tree0e5835cec2acaa4ce0bf7c760c36158350dd55bc /src
parente9624929302ad7f10d38a8de21dd0d7f5aa1f675 (diff)
fix inline js in x86 target, enable testing sans validation for inline js in asm.js, fix unistd tests that use inline js to not validate, and make js optimizer more tolerant of inline js in asm code; fixes #1597
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 31e97bd0..5432b1ca 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -712,11 +712,13 @@ function intertyper(data, sidePass, baseLineNums) {
if (tokensLeft[0].text == 'sideeffect') tokensLeft.splice(0, 1);
item.ident = tokensLeft[0].text.substr(1, tokensLeft[0].text.length-2) || ';'; // use ; for empty inline assembly
var i = 0;
- splitTokenList(tokensLeft[3].item.tokens).map(function(element) {
- var ident = toNiceIdent(element[1].text);
- var type = element[0].text;
- item.ident = item.ident.replace(new RegExp('\\$' + i++, 'g'), ident);
- });
+ if (tokensLeft[3].item) { // not present in x86 inline asm
+ splitTokenList(tokensLeft[3].item.tokens).map(function(element) {
+ var ident = toNiceIdent(element[1].text);
+ var type = element[0].text;
+ item.ident = item.ident.replace(new RegExp('\\$' + i++, 'g'), ident);
+ });
+ }
return { forward: null, ret: [item], item: item };
}
if (item.ident.substr(-2) == '()') {