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

[MERGED] Fix the array return bug #567

Closed
wants to merge 4 commits into from

Conversation

Daniel-Cortez
Copy link
Contributor

What this PR does / why we need it:

Fixes bad code generation when returning an array returned by another function (see #293).

Which issue(s) this PR fixes:

Fixes #293

What kind of pull this is:

  • A Bug Fix
  • A New Feature
  • Some repository meta (documentation, etc)
  • Other

Additional Documentation:

The test code is based on the array return bug demonstration by @Southclaws.

@Daniel-Cortez Daniel-Cortez requested a review from a team as a code owner September 3, 2020 14:38
…xpressions inside a single `return` statement

Example:
```
StringOrigin()
{
    static const string[] = "Hello world";
    return string;
}

ReturnString()
{
    return StringOrigin(), StringOrigin();
}
```
Before this fix, the heap space allocated by the first `StringOrigin()` call wasn't being freed.
@Y-Less Y-Less closed this Sep 19, 2020
@Y-Less Y-Less changed the title Fix the array return bug [MERGED] Fix the array return bug Sep 20, 2020
@Daniel-Cortez Daniel-Cortez deleted the fix-293 branch October 19, 2020 13:40
@afwn90cj93201nixr2e1re
Copy link

afwn90cj93201nixr2e1re commented Nov 24, 2020

Is that produce memory leaks in run-time?

@Y-Less
Copy link
Member

Y-Less commented Jan 15, 2022

Is that produce memory leaks in run-time?

It doesn't leak, no. Pawn itself doesn't really have memory leaks, those all come from plugins.

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.

None yet

3 participants