Explorar o código

Only add packing if the padding is non-zero for a #raw_union constant

gingerBill hai 2 semanas
pai
achega
89645921e2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/llvm_backend_const.cpp

+ 1 - 1
src/llvm_backend_const.cpp

@@ -1513,7 +1513,7 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, lb
 							values[value_count++] = LLVMConstNull(padding_type);
 						}
 
-						LLVMValueRef res = LLVMConstStructInContext(m->ctx, values, value_count, true);
+						LLVMValueRef res = LLVMConstStructInContext(m->ctx, values, value_count, /*packed*/padding > 0);
 
 						return {res, original_type};
 					}