diff options
-rw-r--r-- | src/intertyper.js | 15 | ||||
-rw-r--r-- | tests/cases/emptystruct.ll | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 445c37f4..6da30ae8 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -537,12 +537,17 @@ function intertyper(data, sidePass, baseLineNums) { }); } } else if (!external) { - if (item.tokens[3].text == 'c') - item.tokens.splice(3, 1); - if (item.tokens[3].text in PARSABLE_LLVM_FUNCTIONS) { - ret.value = parseLLVMFunctionCall(item.tokens.slice(2)); + if (item.tokens[3] && item.tokens[3].text != ';') { + if (item.tokens[3].text == 'c') { + item.tokens.splice(3, 1); + } + if (item.tokens[3].text in PARSABLE_LLVM_FUNCTIONS) { + ret.value = parseLLVMFunctionCall(item.tokens.slice(2)); + } else { + ret.value = scanConst(item.tokens[3], ret.type); + } } else { - ret.value = scanConst(item.tokens[3], ret.type); + ret.value = { intertype: 'value', ident: '0', value: '0', type: ret.type }; } } return [ret]; diff --git a/tests/cases/emptystruct.ll b/tests/cases/emptystruct.ll index 67967e65..ecf0e295 100644 --- a/tests/cases/emptystruct.ll +++ b/tests/cases/emptystruct.ll @@ -6,6 +6,8 @@ target triple = "i386-pc-linux-gnu" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] +@.waka = extern_weak global i8* ; no initializer! + define i32 @main() nounwind { entry: %z = alloca %struct.s, align 4 |