diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 2 | ||||
-rw-r--r-- | src/preamble.js | 4 | ||||
-rw-r--r-- | src/runtime.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 932acbe5..2ffae602 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -389,7 +389,7 @@ function intertyper(data, parseFunctions) { return [{ __result__: true, intertype: 'label', - ident: LLVM_STYLE == 'old' ? + ident: item.tokens[0].text.substr(-1) == ':' ? '%' + item.tokens[0].text.substr(0, item.tokens[0].text.length-1) : '%' + item.tokens[2].text.substr(1), lineNum: item.lineNum, diff --git a/src/preamble.js b/src/preamble.js index 439e0e41..bff5b91a 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -226,7 +226,7 @@ function __formatString() { var argIndex = 1; var ret = []; var curr = -1; - while (curr != 0) { + while (curr) { // Note: should be curr != 0, technically. But this helps catch bugs with undefineds #if USE_TYPED_ARRAYS curr = IHEAP[textIndex]; next = IHEAP[textIndex+1]; @@ -332,7 +332,7 @@ _llvm_memset_p0i8_i64 = _llvm_memset_p0i8_i32 = llvm_memset_i32; function _strlen(ptr) { var i = 0; - while (IHEAP[ptr+i] != 0) i++; + while (IHEAP[ptr+i]) i++; // Note: should be IHEAP[ptr+i] != 0, technically. But this helps catch bugs with undefineds return i; } diff --git a/src/runtime.js b/src/runtime.js index cdd85ab3..daa9086d 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -5,7 +5,7 @@ RuntimeGenerator = { alloc: function(size, type) { var ret = type + 'TOP'; -// ret += '; for (var i = 0; i < ' + size + '; i++) HEAP[' + type + 'TOP+i] = 0'; +// ret += '; for (var i = 0; i < ' + size + '; i++) HEAP[' + type + 'TOP+i] = 0'; // No need for typed arrays - per the spec, initialized to 0 anyhow if (GUARD_MEMORY) { ret += '; assert(' + size + ' > 0)'; } |