diff options
| author | gingerBill <bill@gingerbill.org> | 2019-12-31 14:21:16 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-12-31 14:21:16 +0000 |
| commit | b288613307eb5d1c43b8a5c3f4ea5b88696b42f8 (patch) | |
| tree | 4ad1ab134c44bad34bce70d0af66746e95e811ac /src/ir.cpp | |
| parent | 45913537245586b684846a03c308703bdcf15fc1 (diff) | |
Add extra check for ZeroInit instruction
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index b0d43d7f4..4e34a02f8 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -3008,7 +3008,8 @@ void ir_emit_zero_init(irProcedure *p, irValue *address, Ast *expr) { args[1] = ir_const_int(type_size_of(t)); AstPackage *pkg_runtime = get_core_package(p->module->info, str_lit("runtime")); if (p->entity != nullptr) { - if (p->entity->pkg != pkg_runtime && p->entity->token.string != "mem_zero") { + String name = p->entity->token.string; + if (p->entity->pkg != pkg_runtime && !(name == "mem_zero" || name == "memset")) { ir_emit_comment(p, str_lit("ZeroInit")); irValue *v = ir_emit_package_call(p, "runtime", "mem_zero", args, expr); return; |