From 8625d3a2708e6332083a1b780b4f016beacf67d3 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 19 Apr 2024 23:21:01 -0600 Subject: CFG captures both VBranch paths --- vaporize/library/CFGNode.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'vaporize/library/CFGNode.java') 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) { -- cgit v1.2.3