pike.git/
src/
docode.c
Branch:
Tag:
Non-build tags
All tags
No tags
2003-08-03
2003-08-03 00:58:06 by Martin Stjernholm <mast@lysator.liu.se>
5d642e468b0efd415e852293d6f4d91e9d2bb871 (
37
lines) (+
23
/-
14
)
[
Show
|
Annotate
]
Branch:
7.9
Fixed handling of IDREF_MAGIC_THIS.
Rev: src/docode.c:1.165
Rev: src/las.c:1.338
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: docode.c,v 1.
164
2003/
04
/
02
19
:
22
:42 mast Exp $
+
|| $Id: docode.c,v 1.
165
2003/
08
/
03
00
:
52
:42 mast Exp $
*/ #include "global.h"
-
RCSID("$Id: docode.c,v 1.
164
2003/
04
/
02
19
:
22
:42 mast Exp $");
+
RCSID("$Id: docode.c,v 1.
165
2003/
08
/
03
00
:
52
:42 mast Exp $");
#include "las.h" #include "program.h" #include "pike_types.h"
682:
{ if(flags & WANT_LVALUE) {
+
if (n->u.integer.b == IDREF_MAGIC_THIS)
+
yyerror ("Cannot assign to this.");
emit2(F_EXTERNAL_LVALUE, n->u.integer.b, level); return 2; }else{
694:
emit1(F_GLOBAL_LVALUE, n->u.integer.b); return 2; }else{
+
if (n->u.integer.b == IDREF_MAGIC_THIS)
+
emit1(F_THIS_OBJECT, 0);
+
else {
struct identifier *id = ID_FROM_INT(state->new_program,n->u.integer.b); if(IDENTIFIER_IS_FUNCTION(id->identifier_flags) && id->identifier_flags & IDENTIFIER_HAS_BODY)
705:
}else{ emit1(F_GLOBAL, n->u.integer.b); }
+
}
return 1; } }
991:
if(Pike_compiler ->new_program->id == CDR(n)->u.integer.a) { /* Check that it is a variable */
-
if(IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program, CDR(n)->u.integer.b)->identifier_flags))
+
if(
CDR(n)->u.integer.b != IDREF_MAGIC_THIS &&
+
IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program, CDR(n)->u.integer.b)->identifier_flags))
{ code_expression(CAR(n), 0, "RHS"); emit1(flags & DO_POP ? F_ASSIGN_GLOBAL_AND_POP:F_ASSIGN_GLOBAL,
1505:
return do_lfun_call(CAR(n)->u.id.number, CDR(n)); } else if(CAR(n)->token == F_EXTERNAL &&
-
CAR(n)->u.integer.a == Pike_compiler->new_program->id)
+
CAR(n)->u.integer.a == Pike_compiler->new_program->id
&&
+
CAR(n
)
->u.integer.b != IDREF_MAGIC_THIS)
{ return do_lfun_call(CAR(n)->u.integer.b, CDR(n)); }