-
Notifications
You must be signed in to change notification settings - Fork 76
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
Support stack-allocating functions when allocating heap vars #1179
Support stack-allocating functions when allocating heap vars #1179
Conversation
I'm only wondering about one thing, namely
Iirc, |
Indeed there should be just one definition of |
Both |
Co-authored-by: Simmo Saan <simmo.saan@gmail.com>
* HeapVar -> AllocVar * IsDynamicallyAlloced -> IsAllocVar
Sorry for not waiting on your review @sim642, but things are starting to get urgent in order for @mrstanb's changes being all set and integrated with the rest in time for us to still run benchmarks without opening another staging branch and the hassle that creates. |
During the SV-COMP benchmark runs, we noticed that calls to
alloca()
and__builtin_alloca()
result in heap variables being allocated during analysis. However, when passing memory, allocated with these function, tofree()
no warning was produced, since Goblint couldn't differentiate between stack- and heap-allocated heap vars.This PR:
Queries.HeapVar
, s.t. it now takes a boolean flag indicating whether the heap variable in the query answer is allocated on the stack or the heapQueries.IsDynamicallyAlloced
which works likeQueries.IsHeapVar
with the difference that it also differentiates whether the heap var is one abstracting stack or heap memoryTODOs:
alloca()
-like functions, for each function that callsalloca()
-like functionsuseAfterFree
can free memory, allocated viaalloca()
-like functions, as soon as a function that calledalloca()
is returned from