This is the mail archive of the kawa@sourceware.org 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: Problem using MyType[] in macros


On 01/23/2012 04:38 PM, Per Bothner wrote:
On 01/23/2012 02:23 PM, Bill Robinson wrote:
Hello.

I have just spent the evening reducing my original code down, and
perhaps this is a bug. I can't work it out:
....
This is the result I'm getting:
(compiling test.scm)
test.scm:2:1: evaluating syntax transformer 'my-macro' threw
java.lang.ArrayIndexOutOfBoundsException

Definitely a bug in Kawa's syntax-case handling.


Investigating further with Eclipse's debugger, SyntaxPattern.allocVars
is getting called with varCount = 2 and outer being an array of 8
long, so outer and it's 8 entries don't fit into the new vars array.
The variable outer is [(int), null, null, null, null, null, null,
null] in the debugger.

Hm. It's possible allocating a larger array is the correct fix. However, I have to think about this code (it's been a while since I wrote it) and think about what should happen when we have nested syntax-case forms. (with-syntax expands to a syntax-case.)

-- --Per Bothner per@bothner.com http://per.bothner.com/


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