Skip to content

Implement caller#2517

Open
ike709 wants to merge 4 commits intoOpenDreamProject:masterfrom
ike709:callhermaybe
Open

Implement caller#2517
ike709 wants to merge 4 commits intoOpenDreamProject:masterfrom
ike709:callhermaybe

Conversation

@ike709
Copy link
Collaborator

@ike709 ike709 commented Jan 30, 2026

#2203

This is admittedly a bit awful but the alternative is every single proccall storing its ProcState on the called proc even when nobody utilizes or cares about caller.

@boring-cyborg boring-cyborg bot added Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels Jan 30, 2026
@ike709 ike709 requested a review from wixoaGit January 30, 2026 01:09
@ike709
Copy link
Collaborator Author

ike709 commented Jan 30, 2026

Need to cope with async proc states.

@ike709 ike709 marked this pull request as draft January 30, 2026 01:34
@ike709 ike709 mentioned this pull request Jan 31, 2026
@ike709 ike709 marked this pull request as ready for review February 7, 2026 04:19
@@ -0,0 +1,16 @@
/datum/meep/proc/bar()
ASSERT(caller.caller.caller.name == "ihateithere")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be "RunTest"?

Could also be using nameof(/proc/RunTest) for these asserts instead.

/// </summary>
private void SetCaller() {
if (ProcState is null || _caller is not null) return;
if (ProcState.Thread.PeekStack(1) is not DMProcState dmProcState) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always passing an index of 1 is incorrect

case "caller":
// TODO
value = DreamValue.Null;
SetCaller(); // sometimes ProcState is null in the constructor?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't ProcState always be null in the constructor? It's not passed to the constructor or set in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants