pike.git/
src/
program.c
Branch:
Tag:
Non-build tags
All tags
No tags
2016-05-05
2016-05-05 08:45:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>
aaa36a48310b3084df34f1fd03c6a3c6c8e94baf (
18
lines) (+
12
/-
6
)
[
Show
|
Annotate
]
Branch:
8.1
Compiler: Use find_inherited_identifier() for ::this_program.
2043:
/* Unspecified inherit, but not inherit #0. */ struct node_s *res = NULL; struct program *p = inherit_state->new_program;
-
assert(!inherit_depth);
+
for (inh = 1; inh < p->num_inherits; inh++) {
-
+
struct node_s *n;
if (p->inherits[inh].inherit_level != 1) continue; /* NB: We can't recurse here, as that would resolve the magic * identifiers multiple times on multiple inherit.
2052:
id = low_reference_inherited_identifier(inherit_state, inh, ident, SEE_PROTECTED); if (id == -1) continue;
+
if (inherit_depth) {
+
n = mkexternalnode(inherit_state->new_program, id);
+
} else {
+
n = mkidentifiernode(id);
+
}
if (res) {
-
res = mknode(F_ARG_LIST, res,
mkidentifiernode(id
)
)
;
+
res = mknode(F_ARG_LIST, res,
n
);
} else {
-
res =
mkidentifiernode(id)
;
+
res =
n
;
} } if (res) {
2189:
} /* Find ::name in the parent. */
-
i
=
reference
_inherited_identifier(state->previous,
NULL
, name);
-
if (
i == -1
) {
+
n
=
find
_inherited_identifier(state->previous,
state_depth+1
,
-2,
+
name);
+
if (
!n
) {
my_yyerror("Failed to find previous inherited definition of %S " "in parent.", name); return NULL; }
-
n = mkexternalnode(parent, i);
+
} else { n = mkefuncallnode("object_program", mkthisnode(state->new_program, inherit_num));