Bug 24275 – pragma(mangle, ...) can hijack safe functions, bypassing @safe checks

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-12-08T16:28:28Z
Last change time
2024-12-13T19:32:08Z
Keywords
safe
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#20368 →

Comments

Comment #0 by timon.gehr — 2023-12-08T16:28:28Z
DMD 2.106.0: ```d @safe: import std.stdio; pragma(mangle,bar.mangleof) void foo()@system{ writeln("corrupted memory"); } void bar()@safe{ writeln("beningn code"); } void main()@safe{ bar(); } ``` Prints: "corrupted memory".
Comment #1 by robert.schadek — 2024-12-13T19:32:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20368 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB