Skip to content

Commit

Permalink
Zero is not a power of two in ℝ, but it's a way to clear the alignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewycky committed Aug 26, 2019
1 parent 2ac4264 commit 95555f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/values/instruction_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl InstructionValue {
// SubTypes: Only apply to memory access and alloca instructions
/// Sets alignment on a memory access instruction or alloca.
pub fn set_alignment(&self, alignment: u32) -> Result<(), &'static str> {
if !alignment.is_power_of_two() {
if !alignment.is_power_of_two() && alignment != 0 {
return Err("Alignment is not a power of 2!");
}
unsafe {
Expand Down

0 comments on commit 95555f2

Please sign in to comment.