You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #808 I implemented llvm_sizeof as a function that takes an LLVMModule argument. I'm not sure if this is exactly what you want; the alternative would have been a monadic function that runs in the CrucibleSetup monad: llvm_sizeof : LLVMType -> CrucibleSetup Int.
In any case, a simple pure type LLVMType -> Int is not possible, as we need an LLVM type context to know how to interpret alias types, struct padding, and alignment; and there is no such LLVM type context available in the saw-script TopLevel monad.
Let's add a
llvm_sizeof
command that returns the size (in bytes) of the givenLLVMType
. This should mirror thesizeof
from C. The existing code that does that calculation incrucible_alloc
is around https://github.com/GaloisInc/saw-script/blob/master/src/SAWScript/Crucible/LLVM/Builtins.hs#L1709.The text was updated successfully, but these errors were encountered: