aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-01-09 19:29:51 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-16 21:58:51 -0500
commitb6c8fead00aa5d7b39697aedb0cb1eef53010b83 (patch)
tree1c91dd3aff35d3334f8fdf8b1f37d6246974a564 /src/analyze.cpp
parentfbcee58cfcabddd3e0842e22141a983a8169502f (diff)
downloadzig-b6c8fead00aa5d7b39697aedb0cb1eef53010b83.tar.gz
zig-b6c8fead00aa5d7b39697aedb0cb1eef53010b83.zip
fix regression in global const alignment
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 435020014d..fe0b396d28 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -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;