fix #20508 escaping sliced stack arrays not detected
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️
- In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example,
Fix Bugzilla Issue 12345orFix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#22207"
m_lock.performLocked!({ m_streamWSize[sid] = newWin; });
| ^ | ../.dub/packages/vibe-http/1.3.1/vibe-http/source/vibe/http/internal/http2/exchange.d(84,9): Error: returning scope variable
resis not allowed in a@safefunction
Anyone know anything about this code?
@dkorpel may need to enable this with an edition
may need to enable this with an
edition
If you guard the code with if (sc.hasEdition(Edition.v2024)) it will only take effect from that edition onwards.
Anyone know anything about this code?
https://github.com/vibe-d/vibe-http/blob/94e4d1fe6c5eace1de38456a79040c5e94b422e7/source/vibe/http/internal/http2/exchange.d#L55
It looks like it incorrectly marks the allocator parameter as scope instead of return scope in a @safe function, which should be an error but it passes because it's not compiled with -preview=dip1000. This PR restricts returning scope variables even without dip1000, so it now breaks.
@dkorpel I added the edition check, thanks!
This is ready to go.