summaryrefslogtreecommitdiff
path: root/vaporize/library/CFGNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'vaporize/library/CFGNode.java')
-rw-r--r--vaporize/library/CFGNode.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/vaporize/library/CFGNode.java b/vaporize/library/CFGNode.java
index a01bfb0..0afce60 100644
--- a/vaporize/library/CFGNode.java
+++ b/vaporize/library/CFGNode.java
@@ -1,6 +1,8 @@
package vaporize.library;
+import misc.*;
import cs132.vapor.ast.*;
+
import java.util.ArrayList;
class CFGNode {
@@ -25,9 +27,18 @@ class CFGNode {
return this.line;
}
- public boolean equals(Node other) {
- return other.sourcePos ==
- this.instruction.sourcePos;
+ /**
+ * For if we only have a line
+ * number. (VBranch issues)
+ */
+ // FIXME
+ public boolean equals(Object other) {
+ return (other instanceof Node &&
+ (((Node) other).sourcePos ==
+ this.instruction.sourcePos)) ||
+ (other instanceof Integer &&
+ (((Integer) other)
+ .equals(this.instruction.sourcePos.line)));
}
protected void addSource(CFGNode node) {