|
From: | Daniel Colascione |
Subject: | Re: Conservative GC isn't safe |
Date: | Mon, 28 Nov 2016 09:51:37 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 11/26/2016 07:05 AM, Stefan Monnier wrote:
How would you assert dynamically that if an interval is reachable, its owning string or buffer must be too?You don't. You check it statically (by a human).It's not enough for the variable holding the reference to the string or buffer to be in scope: you have to be sure that the reference isn't dead.It should be: if it's in scope, it's not dead.
That's not the case. struct foo* f = something(); int* x = f->&field; something_else(); // invalidate global memory *x = 5; // f is dead here, but still in scopeEven if you don't write this kind of code, the compiler is allowed to generate it.
[Prev in Thread] | Current Thread | [Next in Thread] |