Re: bug in InstructionList: shouldn't dispose Instruction's on delete
Andrew Huntwork <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
whoops, that's really not the right test case. Here's the real thing:
InstructionList il = new InstructionList();
InstructionHandle nop = il.append(new NOP());
GOTO g = new GOTO(nop);
il.append(g);
il.delete(il.append(g));
if(g.getTarget() == null)
panic();
Andrew Huntwork wrote:
> I'm ending up with an InstructionList that contains a goto Instruction
> whose target is null, and the reason for that is the call to dispose()
> on line 737 of InstructionList.java. I believe lines 736 and 737 should
> just be removed. An Instruction can be the instruction for multiple
> handles, so deleting one should not invalidate the instruction of the
> other handles. I can provide sample code to demonstrate what i'm
> talking about, but I think it would go something like this:
>
> InstructionList il = new InstructionList();
> InstructionHandle nop = il.append(new NOP());
> InstructionHandle goto1 = il.append(new GOTO(nop));
> InstructionHandle goto2 = il.append(new GOTO(nop));
> il.delete(goto2);
> if(((GOTO)goto1.getInstruction()).getTarget() == null)
> panic("It really should be nop");
>
--
"I say to you that the VCR is to the American film
producer and the American public as the Boston
strangler is to the woman home alone."
-Jack Valenti, President, Motion Picture
Association of America, Inc., before
The House Subcommittee on Courts, Civil
Liberties, and The Administration of
Justice, August, 1982,
http://cryptome.org/hrcw-hear.htm