summaryrefslogtreecommitdiffstats
path: root/struct.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-12-09 20:02:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-12-09 20:02:39 -0800
commite7cb34ec471b9a212ed9d7b067c5f0bd5282c89f (patch)
tree4d3a19b15d5c6b448a7d79e5cc256a253bdcad67 /struct.h
parent6cf10451395c20fad177704a3b5032106d083b88 (diff)
downloadtxr-e7cb34ec471b9a212ed9d7b067c5f0bd5282c89f.tar.gz
txr-e7cb34ec471b9a212ed9d7b067c5f0bd5282c89f.tar.bz2
txr-e7cb34ec471b9a212ed9d7b067c5f0bd5282c89f.zip
structs: bugfix: crash in static slot inheritance.
* struct.c (make_struct_type): When a struct defines a static slot that exists as an instancee slot in the supertype, there is a crash. This is because the code assumes that the supertype's slot is static. The index value m ends up negative due to subtracting STATIC_SLOT_BASE from an instance slot index, and so the code tries to copy the value of a negatively indexed static slot from the supertype into the new static slot. We can fix this by not doing the copy when a negative index has been calculated. That way we treat the situation as if the supertype didn't have that slot at all.
Diffstat (limited to 'struct.h')
0 files changed, 0 insertions, 0 deletions