disassembler: fix bug omitting exported vars not used in module
commitea8e355c080bfc286042ec2515227fcaf5d85579
authorrofl0r <rofl0r@users.noreply.github.com>
Sun, 1 Dec 2019 00:08:53 +0000 (1 00:08 +0000)
committerrofl0r <rofl0r@users.noreply.github.com>
Sun, 1 Dec 2019 00:08:53 +0000 (1 00:08 +0000)
tree7b1f826fa6d6c3ee25206a051eccfce04d99120e
parent2bf0efb18d0e8195281587b48ba53d8396e3d9ce
disassembler: fix bug omitting exported vars not used in module

game `tales of jayvin` puts some variables in one script, then
uses them only from another, but not the one it was defined in.

repacking it with re-assembled scripts failed with import error.

when resolving variable offsets/names/sizes for data section
we therefore need to check for an export whenever fixup lookup
(means variable is used from .text) fails.

the reason export check is done after code check is that code
check can eventually figure out the correct type of the var,
if certain instructions are used on them, whereas export check
must assume the type is char for safety.
Script.c