-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stable-symbolic: Properly initialize immutable malloc'd memory (#1004)
Previously, `stable-symbolic` would only initialize mutable memory with symbolic bytes when calling `malloc`. `malloc` can also be used to initialize immutable memory, however, so we must also account for this possibility when `stable-symbolic` is enabled. To this end, we create a new `doConstStoreStableSymbolic` function that is like `doStoreStableSymbolic`, but does not check if the memory being written to is mutable. (This is very much in the spirit of the existing `doArrayStore`/`doArrayConstStore`, `storeRaw`/`storeConstRaw`, and `mallocRaw`/`mallocConstRaw` split.) We now use `doConstStoreStableSymbolic` in the override for `malloc` to ensure that we do not generate a failing assertion when allocating immutable memory. (We also use it in `doAlloca` since this assertion doesn't buy us much when the memory being allocated is always known to be mutable.) See GaloisInc/saw-script#1691 for the motivation behind this bugfix.
- Loading branch information
1 parent
7523723
commit 4bf2ab8
Showing
1 changed file
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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