diff --git a/GhidraDocs/GhidraClass/AdvancedDevelopment/GhidraAdvancedDevelopment.html b/GhidraDocs/GhidraClass/AdvancedDevelopment/GhidraAdvancedDevelopment.html
index c09005c55b..f0a20ac610 100644
--- a/GhidraDocs/GhidraClass/AdvancedDevelopment/GhidraAdvancedDevelopment.html
+++ b/GhidraDocs/GhidraClass/AdvancedDevelopment/GhidraAdvancedDevelopment.html
@@ -910,7 +910,7 @@
@Override
public void run() throws Exception {
- for (Instruction instruction = getFirstInstruction(); instruction != null; instruction = getNextInstruction()) {
+ for (Instruction instruction = getFirstInstruction(); instruction != null; instruction = getInstructionAfter(instruction)) {
if ( monitor.isCancelled() ) {
break;
}
diff --git a/GhidraDocs/GhidraClass/AdvancedDevelopment/contrib/gadc/ghidra_scripts/Lab5Script.java b/GhidraDocs/GhidraClass/AdvancedDevelopment/contrib/gadc/ghidra_scripts/Lab5Script.java
index f2493239ba..d94530e7e7 100644
--- a/GhidraDocs/GhidraClass/AdvancedDevelopment/contrib/gadc/ghidra_scripts/Lab5Script.java
+++ b/GhidraDocs/GhidraClass/AdvancedDevelopment/contrib/gadc/ghidra_scripts/Lab5Script.java
@@ -27,8 +27,9 @@ public class Lab5Script extends GhidraScript {
@Override
public void run() throws Exception {
- Instruction instruction = getFirstInstruction();
- while (instruction != null) {
+
+ for (Instruction instruction = getFirstInstruction(); instruction != null; instruction =
+ getInstructionAfter(instruction)) {
if (monitor.isCancelled()) {
break;
}
@@ -51,7 +52,6 @@ public class Lab5Script extends GhidraScript {
String comment =
"[" + register.getName() + "]=[" + scalar.toString(16, false, false, "", "") + "]";
setEOLComment(instruction.getMinAddress(), comment);
- instruction = getInstructionAfter(instruction);
}
}
}