summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-27 20:39:34 +0100
committerAraq <rumpf_a@web.de>2014-02-27 20:39:34 +0100
commit2f692dcc3ae8820969e61ab86f6f29fe33308e91 (patch)
tree9dd6bbc15adec25e4f3c8b2990929e5b4dae66ad
parente1600f209fd5a2e152f0ff556c10e097e5bec256 (diff)
downloadNim-2f692dcc3ae8820969e61ab86f6f29fe33308e91.tar.gz
make C backend more robust against compiler bugs
-rw-r--r--compiler/cgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 87ed23f36..8da753d04 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -761,6 +761,8 @@ proc genProcAux(m: BModule, prc: PSym) =
   var returnStmt: PRope = nil
   assert(prc.ast != nil)
   if sfPure notin prc.flags and prc.typ.sons[0] != nil:
+    if resultPos >= prc.ast.len:
+      internalError(prc.info, "proc has no result symbol")
     var res = prc.ast.sons[resultPos].sym # get result symbol
     if not isInvalidReturnType(prc.typ.sons[0]):
       if sfNoInit in prc.flags: incl(res.flags, sfNoInit)
/ahoang/Nim/blame/compiler/nimrod.nim?h=devel&id=a6d5707faff21722f22f91c56704c44fc03d47f6'>^
e25474154 ^
f530bbd63 ^


d43febf81 ^
214c7a2eb ^

e25474154 ^
fd62116f6 ^





c617479c6 ^
73919e308 ^
73919e308 ^
e25474154 ^
fc9fdc2b9 ^
e25474154 ^
01dfcf631 ^
fc9fdc2b9 ^
ae0ab9a10 ^
e4e74034c ^
c617479c6 ^
fc9fdc2b9 ^



c617479c6 ^
e4e74034c ^
fc9fdc2b9 ^
3b7ef2288 ^

e25474154 ^
01dfcf631 ^
c617479c6 ^
e25474154 ^
73919e308 ^
627e192f6 ^



fc9fdc2b9 ^
1785c6877 ^
fe285b354 ^

01dfcf631 ^
fe285b354 ^

ff4a69b62 ^
01dfcf631 ^
e25474154 ^
4aba7421f ^

65fdd641a ^
3d7abb958 ^
65fdd641a ^

e25474154 ^

04bd0c368 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80