Bug 43795 - Deleting all instructions of a list shows wrong behaviour
Summary: Deleting all instructions of a list shows wrong behaviour
Status: RESOLVED FIXED
Alias: None
Product: BCEL - Now in Jira
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: issues@commons.apache.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-05 07:37 UTC by Markus Gaisbauer
Modified: 2007-11-07 10:56 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Gaisbauer 2007-11-05 07:37:20 UTC
Deleting all instructions (i.e. everything from start to end) in a list shows 
the following behaviour:

 The length of the list is not 0 afterwards.
 Only the handle of the first instruction is disposed.

To fix the problem, apply the following patch:

Index: InstructionList.java
===================================================================
--- InstructionList.java	(revision 592025)
+++ InstructionList.java	(working copy)
@@ -677,8 +677,9 @@
     private void remove( InstructionHandle prev, InstructionHandle next )
             throws TargetLostException {
         InstructionHandle first, last; // First and last deleted instruction
-        if ((prev == null) && (next == null)) { // singleton list
-            first = last = start;
+        if ((prev == null) && (next == null)) { 
+            first = start;
+			last = end;
             start = end = null;
         } else {
             if (prev == null) { // At start of list
Comment 1 Torsten Curdt 2007-11-07 10:56:51 UTC
Thanks, applied to trunk.