summaryrefslogtreecommitdiff
path: root/vaporize/library/CFGNode.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-19 23:21:01 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-19 23:21:01 -0600
commit8625d3a2708e6332083a1b780b4f016beacf67d3 (patch)
tree07ea3a578a5dcf6d7d20155747e78c3f9c38bbe4 /vaporize/library/CFGNode.java
parentb733f594c4ab0697aff9afdcc45e0421107dec85 (diff)
CFG captures both VBranch paths
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) {