Verified Commit 99ba4342 authored by Camil Staps's avatar Camil Staps 🙂

Fix global_label_string_count when bcgen is called with multiple ABC files

Setting label_module_n=-1 prevented the label name length to be counted
towards the global_label_string_count when we would find a .export
directive later on. This happened for instance when calling bcgen on
some module's ABC and _system.abc: the module refers to _cycle_in_spine
and _print_graph, these are then found in _system.abc, but the string
length was never counted, leading to a memory corruption in the bytecode
parser.
parent 825ffe40
Pipeline #43650 passed with stages
in 11 minutes and 40 seconds
......@@ -172,8 +172,6 @@ struct label *enter_label(char *label_name) {
if (r==0) {
if (label_node_p->label_node_label_p->label_module_n>=0 && label_node_p->label_node_label_p->label_module_n!=module_n) {
if (label_node_p->label_node_label_p->label_offset<0) {
label_node_p->label_node_label_p->label_module_n = -1;
return label_node_p->label_node_label_p;
} else {
struct label *new_label_p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment