mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 16:48:18 +00:00
Fix #1017
This commit is contained in:
@@ -293,6 +293,7 @@ void lb_emit_slice_bounds_check(lbProcedure *p, Token token, lbValue low, lbValu
|
||||
|
||||
bool lb_try_update_alignment(lbValue ptr, unsigned alignment) {
|
||||
LLVMValueRef addr_ptr = ptr.value;
|
||||
if (LLVMIsAGlobalValue(addr_ptr) || LLVMIsAAllocaInst(addr_ptr) || LLVMIsALoadInst(addr_ptr)) {
|
||||
if (LLVMGetAlignment(addr_ptr) < alignment) {
|
||||
if (LLVMIsAAllocaInst(addr_ptr) || LLVMIsAGlobalValue(addr_ptr)) {
|
||||
LLVMSetAlignment(addr_ptr, alignment);
|
||||
@@ -300,6 +301,8 @@ bool lb_try_update_alignment(lbValue ptr, unsigned alignment) {
|
||||
}
|
||||
return LLVMGetAlignment(addr_ptr) >= alignment;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool lb_try_vector_cast(lbModule *m, lbValue ptr, LLVMTypeRef *vector_type_) {
|
||||
Type *array_type = base_type(type_deref(ptr.type));
|
||||
|
||||
Reference in New Issue
Block a user