info-gnuprologjava
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-gnuprologjava] 16-bit VM pointers


From: Matt Lilley
Subject: [Info-gnuprologjava] 16-bit VM pointers
Date: Wed, 26 Nov 2014 08:19:00 +1300 (NZDT)

Hi,

I'm not sure if this is the right address; if not, can someone direct me to the 
right one?

I noticed today while trying to debug some code that GNU Prolog for Java seems 
to be limited to 16-bit pointers in the VM. For example, the retry-me-else 
opcode has a maximum argument of 65535. If you create a predicate with a lot of 
complicated clauses, this can easily be exhausted, and you end up with pointer 
truncation, and ultimately undefined behaviour.

Is there a good reason we cannot extend this to at least 32 bits? I'm happy to 
write the patch if someone has the time to review it. At the *very* least we 
should check in InterpretedByteCode that the retryPosition is less than the 
maximum jump distance and raise an exception if it is.

Regards,
Matt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]