summaryrefslogtreecommitdiff
path: root/src/saveload/saveload.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-04 22:12:39 +0100
committerPatric Stout <github@truebrain.nl>2020-12-06 16:10:58 +0100
commitc98717cb4518d80ccccb2ae1677d0a394542f129 (patch)
treea1c585edd2b1fa672de3fb4e88be8f8efb08f6c1 /src/saveload/saveload.cpp
parentc558936ec3223f95677e182da1325717f8163ef6 (diff)
downloadopenttd-c98717cb4518d80ccccb2ae1677d0a394542f129.tar.xz
Fix: do not add an offset to a nullptr
This is, by specs, undefined behaviour. See https://reviews.llvm.org/D67122 In cases where this is done, optimizations done by LLVM can generate code that causes crashes. GetVariableAddress() had two (legit) ways this could happen: - For SaveLoad set to global - For SaveLoad set to SLE_VAR_NULL, where sld->address is always a nullptr, and object could or could not be a nullptr.
Diffstat (limited to 'src/saveload/saveload.cpp')
0 files changed, 0 insertions, 0 deletions