summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-23 00:09:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-23 21:03:19 +0900
commitc14f230b26aa4f8abe9ecf3814cfebbe584d77c9 (patch)
treeb4d605d19bc2db444a24d41251e7d204bf3a0d30 /compile.c
parenteb301d8aecf454681e78cd7ad6d027e67b121857 (diff)
Assign temporary ID to anonymous ID [Bug #18250]
Dumped iseq binary can not have unnamed symbols/IDs, and ID 0 is stored instead. As `struct rb_id_table` disallows ID 0, also for the distinction, re-assign a new temporary ID based on the local variable table index when loading from the binary, as well as the parser.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5157
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index d3cb079562..efe90bed10 100644
--- a/compile.c
+++ b/compile.c
@@ -11554,6 +11554,7 @@ ibf_load_outer_variables(const struct ibf_load * load, ibf_offset_t outer_variab
for (size_t i = 0; i < table_size; i++) {
ID key = ibf_load_id(load, (ID)ibf_load_small_value(load, &reading_pos));
VALUE value = ibf_load_small_value(load, &reading_pos);
+ if (!key) key = rb_make_temporary_id(i);
rb_id_table_insert(tbl, key, value);
}