Fix initialisation of vvp symbol table values.

In 64-bit Windows, an unsigned long is 32 bits, so initialising the num
member of the union did not properly initialise the ptr member. The num
member isn't actually needed, so eliminate it.
This commit is contained in:
Martin Whitaker 2019-08-01 12:34:47 +01:00
parent 893bb62d82
commit c383d2048c
3 changed files with 3 additions and 4 deletions

View File

@ -676,7 +676,7 @@ struct code_label_resolv_list_s: public resolv_list_s {
bool code_label_resolv_list_s::resolve(bool mes)
{
symbol_value_t val = sym_get_value(sym_codespace, label());
if (val.num) {
if (val.ptr) {
if (cptr2_flag)
code->cptr2 = reinterpret_cast<vvp_code_t>(val.ptr);
else

View File

@ -338,7 +338,7 @@ symbol_value_t symbol_table_s::find_value_(struct tree_node_*cur,
assert(0);
{ symbol_value_t tmp;
tmp.num = 0;
tmp.ptr = 0;
return tmp;
}
}
@ -366,7 +366,7 @@ void symbol_table_s::sym_set_value(const char*key, symbol_value_t val)
symbol_value_t symbol_table_s::sym_get_value(const char*key)
{
symbol_value_t def;
def.num = 0;
def.ptr = 0;
if (root->count == 0) {
/* Handle the special case that this is the very first

View File

@ -49,7 +49,6 @@ typedef struct symbol_value_s {
union {
vvp_net_t*net;
void*ptr;
unsigned long num;
};
} symbol_value_t;