summary refs log tree commit diff stats
path: root/tests/gc
diff options
context:
space:
mode:
authorAndrei Formiga <archimedes_siracusa@hotmail.com>2016-05-27 19:03:15 -0300
committerAndrei Formiga <archimedes_siracusa@hotmail.com>2016-05-27 19:03:15 -0300
commitc439ef2e71f6c98aa0a9de1d2036a5422454171c (patch)
tree63334c840744169563ce39205bb14fca92d60e6c /tests/gc
parent51c62a211bca12cc2f470add7bf64b0f4536d6e6 (diff)
downloadNim-c439ef2e71f6c98aa0a9de1d2036a5422454171c.tar.gz
Fix issue #4001: invalid pragma {. hint[]: off .}
The bug was in processNote, module pragmas. The code assumed that
a nkBracketExpr AST node always had two children (without testing
this), and tried to access elements with index 0 and 1 in the sons
array of the nkBracketExpr node.

The code that triggered the bug was just {. hint[]: off .}
by itself in a module; in this case the nkBracketExpr has only
one children in the sons array, so the code in processNote caused
an out-of-bounds array access.

This commit also adds a test to guarantee that this pragma is
rejected, as is.
Diffstat (limited to 'tests/gc')
0 files changed, 0 insertions, 0 deletions
lt;rumpf_a@web.de> 2012-09-03 00:55:44 +0200 committer Araq <rumpf_a@web.de> 2012-09-03 00:55:44 +0200 term rewriting macros fully implemented; still buggy' href='/ahoang/Nim/commit/compiler/evaltempl.nim?h=devel&id=af7c92c0038763db2ba7d7049d7d18363b15089e'>af7c92c00 ^
5e15dec17 ^
af7c92c00 ^
5e15dec17 ^
af7c92c00 ^
5e15dec17 ^
af7c92c00 ^



























5e15dec17 ^











6fd4b8350 ^
5e15dec17 ^




















af7c92c00 ^













5e15dec17 ^

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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125