Skip to content

Commit

Permalink
fix crash native proc
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Dec 8, 2024
1 parent c9f8c51 commit 58fc167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions OpenDreamRuntime/DreamThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,8 @@ public static DreamValue Run(DreamProc proc, DreamObject src, DreamObject? usr,
var context = new DreamThread(proc.ToString());

if (proc is NativeProc nativeProc) {
var zone = Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:nativeProc.Name);
var result = nativeProc.Call(context, src, usr, new(arguments));
zone?.Dispose();
return result;
using(Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:nativeProc.Name))

Check warning

Code scanning / InspectCode

Explicit argument passed to parameter with caller info attribute Warning

Explicit argument passed to parameter with caller info attribute

Check warning

Code scanning / InspectCode

Explicit argument passed to parameter with caller info attribute Warning

Explicit argument passed to parameter with caller info attribute
return nativeProc.Call(context, src, usr, new(arguments));
}

var state = proc.CreateState(context, src, usr, new DreamProcArguments(arguments));
Expand Down
5 changes: 2 additions & 3 deletions OpenDreamRuntime/Procs/DMProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,8 @@ public void SetReturn(DreamValue value) {
public ProcStatus Call(DreamProc proc, DreamObject? src, DreamProcArguments arguments) {
if (proc is NativeProc p) {
// Skip a whole song and dance.
var zone = Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:p.Name);
Push(p.Call(Thread, src, Usr, arguments));
zone?.Dispose();
using(Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:p.Name))

Check warning

Code scanning / InspectCode

Explicit argument passed to parameter with caller info attribute Warning

Explicit argument passed to parameter with caller info attribute

Check warning

Code scanning / InspectCode

Explicit argument passed to parameter with caller info attribute Warning

Explicit argument passed to parameter with caller info attribute
Push(p.Call(Thread, src, Usr, arguments));
return ProcStatus.Continue;
}

Expand Down

0 comments on commit 58fc167

Please sign in to comment.