Skip to content

Commit

Permalink
Normalizing path used for cfg name
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaneg committed Nov 4, 2024
1 parent 2ff45ec commit dc91a68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
13 changes: 1 addition & 12 deletions .project
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>evm-lisa</name>
<comment>Project emv-lisa created by Buildship.</comment>
<comment></comment>
<projects>
</projects>
<buildSpec>
Expand All @@ -20,15 +20,4 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1698415238879</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
5 changes: 4 additions & 1 deletion src/main/java/it/unipr/frontend/EVMCFGGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
import java.util.Map;
import java.util.Map.Entry;

import org.apache.commons.io.FilenameUtils;

/**
* Provides methods to generate a CFG from a smart contract.
*/
Expand Down Expand Up @@ -90,8 +92,9 @@ public EVMCFGGenerator(String filePath, Program program) {
public CFG visitProgram(ProgramContext ctx) {
// Create a descriptor for the initial CFG.
ClassUnit unit = new ClassUnit(new ProgramCounterLocation(-1, -1), program, "program", false);
String normalizedFilePath = FilenameUtils.separatorsToUnix(filePath);
CodeMemberDescriptor cfgDesc = new CodeMemberDescriptor(new ProgramCounterLocation(-1, -1), unit, false,
filePath, new Parameter[] {});
normalizedFilePath, new Parameter[] {});

// Save the CFG in the class variable.
this.cfg = new EVMCFG(cfgDesc);
Expand Down

0 comments on commit dc91a68

Please sign in to comment.