mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Initialize node_id
In some causes node_id might have been left uninitialized leading to undefined behavior on access. So always set it to -1, so we have *some* valid value in there.
This commit is contained in:
parent
3b8279e91f
commit
c69ad738dc
Notes:
git
2022-08-01 10:37:07 +09:00
1 changed files with 1 additions and 0 deletions
1
node.c
1
node.c
|
@ -1138,6 +1138,7 @@ rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
|
|||
n->nd_loc.beg_pos.column = 0;
|
||||
n->nd_loc.end_pos.lineno = 0;
|
||||
n->nd_loc.end_pos.column = 0;
|
||||
n->node_id = -1;
|
||||
}
|
||||
|
||||
typedef struct node_buffer_elem_struct {
|
||||
|
|
Loading…
Reference in a new issue