Implement variant of crucible_alloc with user-specified alignment #633
Labels
subsystem: crucible-llvm
Issues related to LLVM bitcode verification with crucible-llvm
type: enhancement
Issues describing an improvement to an existing feature or capability
In a CrucibleSetup block,
crucible_alloc
always chooses an alignment based on the maximum required for any primitive type (usually 8 bytes).saw-script/src/SAWScript/Crucible/LLVM/Builtins.hs
Lines 679 to 691 in 15d2548
However, sometimes C/LLVM functions might require more-aligned pointers. E.g. if a type is declared with
__attribute__((aligned(64)))
, then dereferencing a pointer to it would require 64-byte alignment. (Thanks to @andreistefanescu for bringing this to my attention.)To support specifying and verifying such code, we should implement a variant of
crucible_alloc
called something likecrucible_alloc_aligned
that takes an extra numeric argument for the desired alignment. This should be pretty easy to implement, as the Crucible/LLVM memory model allows arbitrary alignments to be specified for each allocation.The text was updated successfully, but these errors were encountered: