Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed disappearing returns #1681

Merged

Conversation

XdotCore
Copy link
Contributor

Description

This fixes issue #1456 caused by pr #1191. This issue occurred because the pr would remove any exit instruction that wasn't followed by an operation starting with push int, which removed simple return;s that didn't meet that req because they compile to exit (while return value; compiles to ret). Thanks to @Jacky720 for a better way than my initial solution in #1680

Caveats

Haven't done proper testing

Notes

N/A

@Jacky720
Copy link
Contributor

Jacky720 commented Feb 13, 2024

This also resolves #1223 (and maybe some more, we have a big issues backlog).

@Miepee
Copy link
Contributor

Miepee commented Feb 17, 2024

Can someone test this please?

@Dobby233Liu
Copy link
Contributor

Dobby233Liu commented Feb 17, 2024

Can someone test this please?

Scuffed test

Before PR: 4cb37e6
After PR: Dobby233Liu@fc11913

In DR Ch 1&2 v1.10 (2022.1),

  1. Open gml_GlobalScript_scr_create_hitbox_solid, insert right after start of body
    if global.darkzone != 1 return;
    • Before PR: compiles to
       if ((global.darkzone != true))
       {
       }
    • After PR: compiles to
       if ((global.darkzone != true))
           return;
  2. Open gml_Object_o_boxingflame_Create_0, insert before line 1
    if (instance_exists(o_boxingqueen) == 0) return;
    • Before PR: compiles to
       if ((instance_exists(o_boxingqueen) == 0))
       	return;
    • After PR: compiles to
       if ((instance_exists(o_boxingqueen) == 0))
           return;

With ULCA Deltarune skit program which is 2023.1 ,

  1. Open gml_Object_obj_event_anxietyrealized_Create_0, and insert before line 1
    if global.chapter != 3 { exit; }
    • Before PR: compiles to
      if ((global.chapter != 3))
          return;
    • After PR: compiles to
      if ((global.chapter != 3))
          return;
  2. Open gml_GlobalScript_scr_mercyadd, insert right after start of body
    if !global.darkzone exit;
    • Before PR: compiles to
       if (!global.darkzone)
           return;
    • After PR: compiles to
      if (!global.darkzone)
         return;

@Miepee
Copy link
Contributor

Miepee commented Feb 17, 2024

ty, probably is good then

@colinator27 colinator27 merged commit 58ac6d4 into UnderminersTeam:master Mar 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants