Commit fa18681b authored by Eduardo Souza's avatar Eduardo Souza

Add minimal alignment for new instruction.

parent 644df015
......@@ -1442,7 +1442,10 @@ pub unsafe fn gen_instr_new(
let data_layout = LLVMGetModuleDataLayout(llvm_internal_context.module);
let size = LLVMABISizeOfType(data_layout, llvm_type);
let size = LLVMConstInt(LLVMInt64Type(), size, false as i32);
let alignment = LLVMABIAlignmentOfType(data_layout, llvm_type);
let mut alignment = LLVMABIAlignmentOfType(data_layout, llvm_type);
if alignment < 4 {
alignment = 4; // Minimal alignment in MMTk
}
let alignment =
LLVMConstInt(LLVMInt64Type(), alignment as u64, false as i32);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment