-
Notifications
You must be signed in to change notification settings - Fork 62
Description
we are auto-dereferencing an uninitialized pointer here - this is undefined behaviour. Should we initialize these pointers with
null
like we are doing forVAR_INPUT {ref}
? Ideally we would check for use before assignment but that feature feels a bit far off still.
Originally posted by @mhasel in #1251 (comment)
I think null makes sense here so that we don't have random values. I'm in favour of not having such tests tbh. We can't test undefined behaviour (by design). Also what happens if the random value is 5? I am more in favour of having a test that verifies the pointer value of foo is null. Not sure how to do this with the auto deref rules.. maybe it's enough to have an IR check that verifies the initial values of REFERENCE TO and Pointer fields in general.
Originally posted by @ghaith in #1251 (comment)