Skip to content

Commit e42bd4f

Browse files
committed
Refactored ProtectedFunctionFinder to use MAX_DEPTH constant for depth limit
1 parent 255c73b commit e42bd4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/it/unipr/crosschain/functions/ProtectedFunctionFinder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class ProtectedFunctionFinder implements
2727

2828
private static final Logger log = LogManager.getLogger(ProtectedFunctionFinder.class);
2929
private final SmartContract contract;
30+
private static final int MAX_DEPTH = 20;
3031

3132
public ProtectedFunctionFinder(SmartContract contract) {
3233
this.contract = contract;
@@ -98,7 +99,7 @@ private void checkForProtection(Statement sink, EVMCFG cfg, Set<Integer> jumpiPp
9899
((ProgramCounterLocation) source.getLocation()).getPc(),
99100
((ProgramCounterLocation) source.getLocation()).getSourceCodeLine());
100101

101-
if (cfg.reachableFromWithDepthLimit(source, sink, 10)
102+
if (cfg.reachableFromWithDepthLimit(source, sink, MAX_DEPTH)
102103
&& jumpiPps.contains(((ProgramCounterLocation) source.getLocation()).getPc())) {
103104
log.debug("Sink {} at pc {} line {}",
104105
sink,

0 commit comments

Comments
 (0)