[Jastadd] Strange update of instance variables.

From: Na, Hyunik <hina_at_kaist.ac.kr>
Date: Sun, 29 Apr 2012 17:24:39 +0900

Hello JastAddJ developers,

 

While I debugged JastAddJ, I found a strange phenomenon.

 

There is a line

 

           CompilationUnit u = program.bytecodeReader.read(is, fullName,
program);

 

in the getCompilationUnit() method of PathPart class defined in
ClassPath.jrag.

 

Before and after that line, the values of instance variables pathName,
relativeName,

and fullName of current PathPart instance are not preserved!

 

Regardless of whether this is intended or not (probably, not), it is
astonishing that this is possible in Java.

The invocation of BytecodeReader.read does not take the current PathPart
instance as an argument and

it has no way to update the instance variables, as far as I know.

 

It looks like memory corruption which is rather common in programs written
in C/C++ which has pointers.

(But, Java does not have pointers.)

 

Have anyone seen this?

 

- Hyunik

 

 

 

 
Received on Sun Apr 29 2012 - 10:24:40 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 17:19:06 CEST