[ nice-Bugs-1113263 ] java.lang.VerifyError
"SourceForge.net" <[email protected]> Sat, 12 Feb 2005 06:28:13 -0800
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1113263, was opened at 2005-01-31 17:22
Message generated for change (Comment added) made by bonniot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1113263&group_id=12788
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 2
Submitted By: Artem Gr Kozarezov (artemgr)
>Assigned to: Arjan Boeijink (arjanb)
Summary: java.lang.VerifyError
Initial Comment:
See attached files for details.
"nice-bug.src.zip" have test case sources.
"nice-bug.bin.zip" have both sources and compiled classes.
----------------------------------------------------------------------
>Comment By: Daniel Bonniot (bonniot)
Date: 2005-02-12 15:28
Message:
Logged In: YES
user_id=88952
I'm closing this report, as the bug reported (the
verification error) is fixed. There is still a valid
discussion as to what the semantics of assert false should
be, but this is a different matter, so it does not really
make sense to keep this bug report open. If you feel like
it, a discussion on nice-info would be appropriate, as it
would allow other people to participate.
----------------------------------------------------------------------
Comment By: Artem Gr Kozarezov (artemgr)
Date: 2005-02-07 16:08
Message:
Logged In: YES
user_id=289741
A shorter test case:
class AssertCaseFail {
void?->void _aFirstPointer = null;
void?->void _aSecondPointer = null;
void aMethod(){
let void->void fun;
let first = _aFirstPointer; let second = _aSecondPointer;
if( null != first ) fun = first;
else if( null != second ) fun = second;
else assert false;
fun();
}
}
void main( String[] ) = ( new AssertCaseFail() ).aMethod();
When compiled with nicec "build 2005.02.07" (assertions are
NOT enabled):
Exception in thread "main" nice.lang.AssertionFailed
at letfun.c.fun.aMethod(c.nice:11)
at letfun.c.AssertCaseFail.aMethod(c.nice)
at letfun.c.fun.main(c.nice:16)
at letfun.c.dispatch.main(dispatch.nice)
When compiled with nicec "build 2004.09.22":
Exception in thread "main" java.lang.VerifyError: (class:
letfun/c/fun, method: aMethod signature:
(Lletfun/c/AssertCaseFail;
)V) Register 1 contains wrong type
at letfun.c.dispatch.main(dispatch.nice)
Expected behaviour is to give a compile-time error about
"fun" being used without being initialized. But the Nice
compiler currently thinks that "assert false" will always
exit from the method, which is wrong when assertions are not
enabled.
----------------------------------------------------------------------
Comment By: Arjan Boeijink (arjanb)
Date: 2005-02-02 00:09
Message:
Logged In: YES
user_id=688815
The problem is the code generation of 'assert false' where the
bytecode verifier can't always know code after that is
unreachable.
I commited a workaround for the codegeneration.
Code being unreachable after 'assert false' is different
behaviour than Java and might be unexpected when
assertions disabled.
http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
Daniel, what's your opinion on this?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1113263&group_id=12788
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click