projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
cache cpp defaults
[m6w6/ext-psi]
/
src
/
context.c
diff --git
a/src/context.c
b/src/context.c
index abe1ff64c79ade60197d11f26d34c2b462976f8f..8fdbf22f41a2701b60833ce59407f3c48b078122 100644
(file)
--- a/
src/context.c
+++ b/
src/context.c
@@
-142,7
+142,7
@@
void psi_context_build(struct psi_context *C, const char *paths)
psi_parser_parse(&P, I);
psi_context_add(C, &P);
psi_parser_dtor(&P);
psi_parser_parse(&P, I);
psi_context_add(C, &P);
psi_parser_dtor(&P);
-
free(
I);
+
psi_parser_input_free(&
I);
}
}
}
}
@@
-176,11
+176,11
@@
zend_function_entry *psi_context_compile(struct psi_context *C)
while (psi_plist_get(C->consts, i++, &c)) {
while (psi_plist_get(C->consts, i++, &c)) {
- if (zend_get_constant
_str(c->name, strlen(c->name)
)) {
+ if (zend_get_constant
(c->name
)) {
continue;
}
continue;
}
- zc.name = zend_string_
init(c->name, strlen(c->name), 1
);
+ zc.name = zend_string_
copy(c->name
);
switch (c->type->type) {
case PSI_T_BOOL:
switch (c->type->type) {
case PSI_T_BOOL:
@@
-196,6
+196,9
@@
zend_function_entry *psi_context_compile(struct psi_context *C)
case PSI_T_STRING:
case PSI_T_QUOTED_STRING:
ZVAL_NEW_STR(&zc.value, zend_string_copy(c->val->ival.zend.str));
case PSI_T_STRING:
case PSI_T_QUOTED_STRING:
ZVAL_NEW_STR(&zc.value, zend_string_copy(c->val->ival.zend.str));
+ if (ZSTR_IS_INTERNED(Z_STR(zc.value))) {
+ Z_TYPE_FLAGS(zc.value) = 0;
+ }
break;
default:
assert(0);
break;
default:
assert(0);
@@
-218,9
+221,9
@@
zend_function_entry *psi_context_compile(struct psi_context *C)
zend_string *name;
if (psi_decl_type_is_anon(e->name, "enum")) {
zend_string *name;
if (psi_decl_type_is_anon(e->name, "enum")) {
- name = strpprintf(0, "psi\\%s", item->name);
+ name = strpprintf(0, "psi\\%s", item->name
->val
);
} else {
} else {
- name = strpprintf(0, "psi\\%s\\%s", e->name
, item->name
);
+ name = strpprintf(0, "psi\\%s\\%s", e->name
->val, item->name->val
);
}
if (zend_get_constant(name)) {
}
if (zend_get_constant(name)) {