Bug 19383 – AA insertion is not exception-safe

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-09T19:11:40Z
Last change time
2024-12-07T13:38:49Z
Assigned to
No Owner
Creator
Stanislav Blinov
Moved to GitHub: dmd#17374 →

Comments

Comment #0 by stanislav.blinov — 2018-11-09T19:11:40Z
void main() { static struct S { bool cond; this(this) { if (cond) throw new Exception("failure"); } } import std.exception; S[int] aa; assertThrown(aa[1] = S(true)); // or assertThrown(aa.require(1, S(true))); assert(aa.keys.length == 0); // fails, aa.keys is now [1] }
Comment #1 by robert.schadek — 2024-12-07T13:38:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17374 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB