aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-19 14:35:59 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-19 14:35:59 -0400
commitb588a803bf4493d2fd1892fe172b9ce8cfb0ca30 (patch)
tree8d5c9306669cc5d185568ec45445d26e326a3fd9 /src/analyze.cpp
parent79671efd3a5b67e359aa60c66e4007c03342b28e (diff)
downloadzig-b588a803bf4493d2fd1892fe172b9ce8cfb0ca30.tar.gz
zig-b588a803bf4493d2fd1892fe172b9ce8cfb0ca30.zip
fix comptime modification of const struct field
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index b39b1e35ca..d048dd9770 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -4711,7 +4711,7 @@ ReqCompTime type_requires_comptime(CodeGen *g, ZigType *type_entry) {
void init_const_str_lit(CodeGen *g, ConstExprValue *const_val, Buf *str) {
auto entry = g->string_literals_table.maybe_get(str);
if (entry != nullptr) {
- *const_val = *entry->value;
+ memcpy(const_val, entry->value, sizeof(ConstExprValue));
return;
}