Bug 4771 – fail_compilation/fail274.d hits a halt in iasm.c
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-08-30T23:52:00Z
Last change time
2010-09-01T22:03:56Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
braddr
Comments
Comment #0 by braddr — 2010-08-30T23:52:18Z
../src/dmd -Ifail_compilation -odtest_results/fail_compilation -oftest_results/fail_compilation/fail274 -c fail_compilation/fail274.d
fail_compilation/fail274.d(2): ] expected instead of ';'
Program received signal SIGSEGV, Segmentation fault.
0x08128b17 in halt () at mars.c:230
230 *(char*)0=0;
(gdb) bt
#0 0x08128b17 in halt () at mars.c:230
#1 0x0811571e in asmerr (errnum=16) at iasm.c:1858
#2 0x0811316c in asm_chktok (toknum=TOKrbracket, errnum=16) at iasm.c:541
#3 0x08118b99 in asm_br_exp () at iasm.c:3840
#4 0x08118898 in asm_mul_exp () at iasm.c:3748
#5 0x081187c3 in asm_add_exp () at iasm.c:3709
#6 0x081186ab in asm_shift_exp () at iasm.c:3681
#7 0x0811857b in asm_rel_exp () at iasm.c:3630
#8 0x08118440 in asm_equal_exp () at iasm.c:3587
#9 0x0811839c in asm_and_exp () at iasm.c:3564
#10 0x081182f8 in asm_xor_exp () at iasm.c:3541
#11 0x08118254 in asm_inc_or_exp () at iasm.c:3518
#12 0x08118198 in asm_log_and_exp () at iasm.c:3495
#13 0x081180dc in asm_log_or_exp () at iasm.c:3473
#14 0x0811807c in asm_cond_exp () at iasm.c:3453
#15 0x081199d4 in AsmStatement::semantic (this=0x820e6f8, sc=0x82430e8) at iasm.c:4478
#16 0x08165818 in CompoundStatement::semantic (this=0x820e740, sc=0x82430e8) at statement.c:481
#17 0x080f82a2 in FuncDeclaration::semantic3 (this=0x820e590, sc=0x8243058) at func.c:1215
#18 0x0812d6b2 in Module::semantic3 (this=0x820e068) at module.c:859
#19 0x0812ab72 in main (argc=11, argv=0x82044d0) at mars.c:1193
A regression hunt shows that this was caused by r605 which did affect iasm.c in big ways (despite the fairly innocent submit comment)
Comment #1 by braddr — 2010-08-30T23:58:23Z
Removing the halt that looks like left a left over debug aid based on it's indentation does remove the problem. The expected test failure still fails as expected.
diff --git a/src/iasm.c b/src/iasm.c
index 2776d73..2261b76 100644
--- a/src/iasm.c
+++ b/src/iasm.c
@@ -1855,7 +1855,6 @@ STATIC void asmerr(int errnum, ...)
printf("\n");
fflush(stdout);
-halt();
longjmp(asmstate.env,1);
}