D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4771 - fail_compilation/fail274.d hits a halt in iasm.c
Summary: fail_compilation/fail274.d hits a halt in iasm.c
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code, patch
Depends on:
Blocks:
 
Reported: 2010-08-30 23:52 UTC by Brad Roberts
Modified: 2010-09-01 22:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Brad Roberts 2010-08-30 23:52:18 UTC
../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 Brad Roberts 2010-08-30 23:58:23 UTC
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);
 }
Comment 2 Walter Bright 2010-09-01 22:03:56 UTC
http://www.dsource.org/projects/dmd/changeset/656