X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ir.c;h=cabddf4e196a6969edaa844fe6bdf360691a5fe0;hp=84455d56a2d48dc0b72bdd31e44e9a699521dfc7;hb=10738da2fb1b72adf1d29cc397b8a0fc836fdea9;hpb=c74889f648b5f530831049ecc3a3db71db6e2db6 diff --git a/ir.c b/ir.c index 84455d5..cabddf4 100644 --- a/ir.c +++ b/ir.c @@ -1206,22 +1206,11 @@ bool ir_value_set_field(ir_value *self, ir_value *fld) return true; } -static char *ir_strdup(const char *str) -{ - if (str && !*str) { - /* actually dup empty strings */ - char *out = (char*)mem_a(1); - *out = 0; - return out; - } - return util_strdup(str); -} - bool ir_value_set_string(ir_value *self, const char *str) { if (self->vtype != TYPE_STRING) return false; - self->constval.vstring = ir_strdup(str); + self->constval.vstring = util_strdupe(str); self->hasvalue = true; return true; } @@ -1651,7 +1640,7 @@ void ir_phi_add(ir_instr* self, ir_block *b, ir_value *v) * is doing something wrong. */ irerror(self->context, "Invalid entry block for PHI"); - abort(); + exit(EXIT_FAILURE); } pe.value = v; @@ -3823,7 +3812,7 @@ void ir_function_dump(ir_function *f, char *ind, } if (vec_size(f->blocks)) { - oprintf("%slife passes: %i\n", ind, (int)f->run_id); + oprintf("%slife passes: %i\n", ind, (int)f->run_id); for (i = 0; i < vec_size(f->blocks); ++i) { ir_block_dump(f->blocks[i], ind, oprintf); }