Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEV with proc of var result returning nothing #4042

Closed
Wh1teDuke opened this issue Apr 4, 2016 · 2 comments
Closed

SIGSEV with proc of var result returning nothing #4042

Wh1teDuke opened this issue Apr 4, 2016 · 2 comments

Comments

@Wh1teDuke
Copy link
Contributor

Test

proc foo: var int = discard
let f = foo()

Result: SIGSEGV: Illegal storage access. (Attempt to read from nil?)

I would expect the compiler to be able to catch situations like this (or a clearer error message).


> nim -v
Nim Compiler Version 0.13.1 (2016-04-04) [Windows: i386]
Copyright (c) 2006-2016 by Andreas Rumpf

git hash: 147961d0069ed434796eed9ceacf52914087f789
active boot switches: -d:release
@Araq
Copy link
Member

Araq commented Apr 4, 2016

See also bug #124

@Araq
Copy link
Member

Araq commented May 28, 2019

Now produces:

temp.nim(2, 21) Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future.

@Araq Araq closed this as completed May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants