Skip to content

Commit

Permalink
fix it for realsies
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Nov 16, 2024
1 parent 5b41f9d commit 2bf720e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DMCompiler/Optimizer/AnnotatedBytecode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ public Location GetLocation() {
return Location;
}

public string ResolveString() {
return DMObjectTree.StringTable[Id];
public string ResolveString(DMCompiler compiler) {
return compiler.DMObjectTree.StringTable[Id];
}
}

Expand Down
2 changes: 1 addition & 1 deletion DMCompiler/Optimizer/PeepholeOptimizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public void Apply(DMCompiler compiler, List<IAnnotatedBytecode> input, int index
var firstString = firstInstruction.GetArg<AnnotatedBytecodeString>(0);
var secondString = ((AnnotatedBytecodeInstruction)input[index+1]).GetArg<AnnotatedBytecodeString>(0);

var combinedId = DMObjectTree.AddString(firstString.ResolveString() + secondString.ResolveString()); // TODO: Currently doesn't handle removing strings from the string tree that have no other references
var combinedId = compiler.DMObjectTree.AddString(firstString.ResolveString(compiler) + secondString.ResolveString(compiler)); // TODO: Currently doesn't handle removing strings from the string tree that have no other references

var args = new List<IAnnotatedBytecode>(1) {new AnnotatedBytecodeString(combinedId, firstInstruction.Location)};

Expand Down

0 comments on commit 2bf720e

Please sign in to comment.