Created
March 26, 2018 12:38
-
-
Save CodeSandwich/333085efb73e8775ddd6633029d6a49b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main { | |
A = allocate() // A's lifetime begins | |
do_stuff(A) // use A | |
B = A // B's lifetime begins | |
do_stuff(B) // use B | |
release(A) // release, A's and B's lifetimes end | |
do_stuff(A) // <RUN TIME FAIL> use A after its lifetime ended | |
do_stuff(B) // <RUN TIME FAIL> use B after its lifetime ended | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment