Reimplement 'parent' construct as variable $parent.
All checks were successful
The build was successful.

This commit also adds new controls to variables, which prevents from re-assigning a value when set. Thanks to that, both $this and $parent cannot be overwritten by using OP_STORE instruction. Other instructions still need some
work.
This commit is contained in:
2019-05-08 08:26:48 +02:00
parent 0c8ca53f70
commit 07bd3ceec3
3 changed files with 28 additions and 20 deletions

View File

@@ -643,6 +643,9 @@ struct ph7_value {
#define MEMOBJ_MIXED 0x0200 /* Memory value is mixed */
#define MEMOBJ_HASHMAP 0x0400 /* Memory value is a hashmap aka 'array' in the PHP jargon */
#define MEMOBJ_NULL 0x0800 /* Memory value is NULL */
/* Special purpose */
#define MEMOBJ_FIXEDVAL 0x1000 /* Memory value is fixed and cannot be modified */
#define MEMOBJ_PARENTOBJ 0x2000 /* Memory value is a parent object */
/* Mask of all known types */
#define MEMOBJ_ALL (MEMOBJ_STRING|MEMOBJ_INT|MEMOBJ_REAL|MEMOBJ_BOOL|MEMOBJ_NULL|MEMOBJ_HASHMAP|MEMOBJ_OBJ|MEMOBJ_RES|MEMOBJ_CALL|MEMOBJ_CHAR|MEMOBJ_VOID)
/* Scalar variables