From: Michael Wallner Date: Fri, 7 Jul 2017 07:27:57 +0000 (+0200) Subject: don't register constants with its anon prefix X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=commitdiff_plain;h=4e221dbe150560ad8847606164b80020249f136e;ds=sidebyside don't register constants with its anon prefix --- diff --git a/src/context.c b/src/context.c index 584994f..6408ebe 100644 --- a/src/context.c +++ b/src/context.c @@ -332,7 +332,13 @@ zend_function_entry *psi_context_compile(struct psi_context *C) struct psi_decl_enum_item *item; while (psi_plist_get(e->items, j++, &item)) { - zend_string *name = strpprintf(0, "psi\\%s\\%s", e->name, item->name); + zend_string *name; + + if (psi_decl_type_is_anon(e->name, "enum")) { + name = strpprintf(0, "psi\\%s", item->name); + } else { + name = strpprintf(0, "psi\\%s\\%s", e->name, item->name); + } zc.name = zend_string_dup(name, 1); ZVAL_LONG(&zc.value, psi_long_num_exp(item->num, NULL, NULL));