You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below example, I've passed a nil interface value to this function and tried to call a pointer method on it, when executing the script I get a panic with nil pointer dereference error message, however nilaway fails to detect this.
The text was updated successfully, but these errors were encountered:
FWIW, for this particular case (and possibly other similar cases from stdlib), we can probably model it in NilAway (basically treating the return value as nilable without analyzing the body). The reason is that it uses functions from runtime (i.e., unsafe here) that NilAway simply cannot analyze, even if told to do so.
reflect package states that TypeOf function will return a nil pointer if a nil interface is passed to as an argument (https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/reflect/type.go;l=1151)
In the below example, I've passed a nil interface value to this function and tried to call a pointer method on it, when executing the script I get a panic with nil pointer dereference error message, however nilaway fails to detect this.
The text was updated successfully, but these errors were encountered: