ID:2830087
 
Resolved
An expression *varname could compile incorrectly in certain cases, causing an implied src prefix before the var to be lost and resulting in runtime errors.
BYOND Version:515.1592
Operating System:Windows 10 Home
Web Browser:Chrome 107.0.0.0
Applies to:Dream Maker
Status: Resolved (515.1593)

This issue has been resolved.
Descriptive Problem Summary:
Attempting to return the value of a pointer in a datum results in a Cannot Read null.var runtime error. This occurs even if the pointer is pointing to a var in the datum.

Code Snippet (if applicable) to Reproduce Problem:
var/a=7

test datum
var/b=0
New()
b=&a
proc/returnb()
return *b

mob/var/testdatum/test = new

mob
Login()
..()
world << "[a]"
world << "________"
world << "[test.returnb()]"


Expected Results: Returns the value of a.

Actual Results: runtimes with a Cannot read null.b

Does the problem occur:
Everytime.

When does the problem NOT occur?
Only when you access b before attempting to return it.

Workarounds:
    proc/returnb()
var/temp = b
return *b

Replacing this with the returnb in code properly returns b as a pointer.
Lummox JR resolved issue with message:
An expression *varname could compile incorrectly in certain cases, causing an implied src prefix before the var to be lost and resulting in runtime errors.