ID:2647066
 
Resolved
In some cases, use of the null-conditional ?. operator could cause the wrong object to be accessed in a subsequent var read/write or proc call.
BYOND Version:513.1539
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 87.0.4280.88
Applies to:Dream Maker
Status: Resolved (513.1540)

This issue has been resolved.
Descriptive Problem Summary:

Posting on request of Lummox.
Sometimes,
thing?.stuff = foo
bar()

will call thing.bar() instead of src.bar().

Code Snippet (if applicable) to Reproduce Problem:
mob
proc/some_proc()
var/datum/a/a

/datum/a
var/foo

/mob/verb/test()
src.a = new
a?.foo = name
some_proc()
some_proc()


Somewhat reliable to reproduce the error, by @pali6

Expected Results: working

Actual Results: Runtime or compile error

Does the problem occur:
Every time? Or how often? only sometimes
In other games? yes
In other user accounts? yes
On other computers? yes

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Before ?. internal changes, 1536 or so.

Workarounds: Don't use ?.

Lummox JR resolved issue with message:
In some cases, use of the null-conditional ?. operator could cause the wrong object to be accessed in a subsequent var read/write or proc call.