return true;
}
+static char *ir_strdup(const char *str)
+{
+ if (str && !*str) {
+ /* actually dup empty strings */
+ char *out = 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 = util_strdup(str);
+ self->constval.vstring = ir_strdup(str);
self->isconst = true;
return true;
}
return parser->imm_float_zero;
}
-char *parser_strdup(const char *str)
+static char *parser_strdup(const char *str)
{
if (str && !*str) {
/* actually dup empty strings */