fix regression in global const alignment

This commit is contained in:
Andrew Kelley
2020-01-09 19:29:51 -05:00
parent fbcee58cfc
commit b6c8fead00
3 changed files with 4 additions and 1 deletions

View File

@@ -9303,7 +9303,9 @@ bool type_has_optional_repr(ZigType *ty) {
}
void copy_const_val(ZigValue *dest, ZigValue *src) {
uint32_t prev_align = dest->llvm_align;
memcpy(dest, src, sizeof(ZigValue));
dest->llvm_align = prev_align;
if (src->special != ConstValSpecialStatic)
return;
dest->parent.id = ConstParentIdNone;