From 1195994880b6a83e61807381df2721ac5256e876 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 27 Feb 2017 00:05:08 -0500 Subject: fix inability to write to global in some cases before, when we initialized a variable by copying the initialization value, it made the internal const value references point to a duplicate value, resulting in a phony duplicate global value being updated instead of the real on. now the behavior is as expected. thanks to hoppetosse for pointing out this bug on IRC. --- src/parseh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parseh.cpp') diff --git a/src/parseh.cpp b/src/parseh.cpp index 5c641e4660..ca7d9e1cd8 100644 --- a/src/parseh.cpp +++ b/src/parseh.cpp @@ -1235,7 +1235,7 @@ static void process_symbol_macros(Context *c) { // variable is non-null and calls it. if (existing_tld->id == TldIdVar) { TldVar *tld_var = (TldVar *)existing_tld; - TypeTableEntry *var_type = tld_var->var->value.type; + TypeTableEntry *var_type = tld_var->var->value->type; if (var_type->id == TypeTableEntryIdMaybe && !tld_var->var->src_is_const) { TypeTableEntry *child_type = var_type->data.maybe.child_type; if (child_type->id == TypeTableEntryIdFn) { -- cgit v1.2.3