This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using (this) in object: wrong result of compilation


Many thanks, it works now!

Per Bothner wrote:

Vladimir Tsichevski wrote:

this compiles to wrong code:

(object () ((bugMethod v) (let ((n v) (r (this))) (display n))))


I checked in the attached patch.

------------------------------------------------------------------------

Index: ChangeLog
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/ChangeLog,v
retrieving revision 1.235
diff -u -r1.235 ChangeLog
--- ChangeLog	21 Apr 2003 07:29:43 -0000	1.235
+++ ChangeLog	28 Apr 2003 01:51:34 -0000
@@ -1,3 +1,8 @@
+2003-04-27  Per Bothner  <per at bothner dot com>
+
+	* ThisExp.java (compile):  Do nothing if IgnoreTarget.  Otherwise call
+	compileFromStack.  Fixes bug reported 04-24 by Vladimir Tsichevski.
+
2003-04-21  Per Bothner  <per at bothner dot com>

	* PrimProcedure.java (compileArgs, compile):  Call usedClass on
Index: ThisExp.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/ThisExp.java,v
retrieving revision 1.4
diff -u -r1.4 ThisExp.java
--- ThisExp.java	25 Aug 2001 00:18:44 -0000	1.4
+++ ThisExp.java	28 Apr 2003 01:51:34 -0000
@@ -33,8 +33,11 @@

  public void compile (Compilation comp, Target target)
  {
+    if (target instanceof IgnoreTarget)
+      return;
    CodeAttr code = comp.getCode();
    code.emitPushThis();
+    target.compileFromStack(comp, getType());
  }

protected Expression walk (ExpWalker walker)





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]