Skip to content

Commit

Permalink
{aarch32-,}symbolic: Additional commentary
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 23, 2024
1 parent 94195b4 commit e9f939a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions macaw-aarch32-symbolic/src/Data/Macaw/AArch32/Symbolic/ABI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Helpful links:
* <https://github.com/ARM-software/abi-aa/blob/a82eef0433556b30539c0d4463768d9feb8cfd0b/aapcs32/aapcs32.rst#621the-stack>
* <https://learn.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-170>
(The latter describes the Microsoft ARM ABI which is slightly different from the
standard ARM ABI, but most of the content still applies.)
This module is meant to be imported qualified.
-}

Expand Down
3 changes: 3 additions & 0 deletions symbolic/src/Data/Macaw/Symbolic/Stack.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ createArrayStack bak mem slots sz = do
(base, mem1) <- mallocStack bak mem sz
mem2 <- CLM.doArrayStore bak mem1 base stackAlign arr sz

-- Put the stack pointer at the end of the stack allocation, i.e., an offset
-- that is one less than the allocation's size.
off <- WI.bvSub sym sz =<< WI.bvOne sym ?ptrWidth
end <- CLM.doPtrAddOffset bak mem2 base off

let ptrBytes = WI.intValue ?ptrWidth `div` 8
let slots' = fromIntegral (getExtraStackSlots slots)
let slotsBytes = slots' * ptrBytes
Expand Down

0 comments on commit e9f939a

Please sign in to comment.