From 4e221dbe150560ad8847606164b80020249f136e Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 7 Jul 2017 09:27:57 +0200 Subject: [PATCH] don't register constants with its anon prefix --- src/context.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)); -- 2.30.2