Mercurial > projects > ddmd
annotate dmd/SwitchErrorStatement.d @ 5:63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
author | dkoroskin <> |
---|---|
date | Tue, 08 Dec 2009 21:39:17 +0300 |
parents | 10317f0c89a5 |
children | 2e2a5c3f943a |
rev | line source |
---|---|
0 | 1 module dmd.SwitchErrorStatement; |
2 | |
3 import dmd.Statement; | |
4 import dmd.OutBuffer; | |
5 import dmd.Loc; | |
6 import dmd.IRState; | |
7 import dmd.HdrGenState; | |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
8 import dmd.BE; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
9 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
10 import dmd.backend.elem; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
11 import dmd.backend.Blockx; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
12 import dmd.backend.Util; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
13 import dmd.backend.TYM; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
14 import dmd.backend.OPER; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
15 import dmd.backend.RTLSYM; |
0 | 16 |
17 class SwitchErrorStatement : Statement | |
18 { | |
19 this(Loc loc) | |
20 { | |
21 super(loc); | |
22 } | |
23 | |
24 BE blockExit() | |
25 { | |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
26 return BE.BEthrow; |
0 | 27 } |
28 | |
29 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | |
30 { | |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
31 buf.writestring("SwitchErrorStatement.toCBuffer()"); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
32 buf.writenl(); |
0 | 33 } |
34 | |
35 void toIR(IRState* irs) | |
36 { | |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
37 elem* e; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
38 elem* elinnum; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
39 elem* efilename; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
40 Blockx* blx = irs.blx; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
41 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
42 //printf("SwitchErrorStatement.toIR()\n"); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
43 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
44 efilename = blx.module_.toEmodulename(); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
45 elinnum = el_long(TYM.TYint, loc.linnum); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
46 e = el_bin(OPER.OPcall, TYM.TYvoid, el_var(rtlsym[RTLSYM_DSWITCHERR]), el_param(elinnum, efilename)); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
47 block_appendexp(blx.curblock, e); |
0 | 48 } |
49 } | |
50 |