[SR-14132] Optional mangled by undefined behavior still shows value in debugDescription #56512
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Reproduces on latest nightly as of 2021/01/30: https://swift.godbolt.org/z/njz9G6
Additional Detail from JIRA
md5: 429106928692c4c41de8354217e84678
Issue Description:
This code admittedly invokes undefined behavior, but the inconsistency between
switch
and the string given bydebugDescription
makes debugging issues of this kind very hard.(See notes on my journey at https://twitter.com/jtbandes/status/1355639304329060358)
The issue reproduces on latest nightly as of 2021/01/30: https://swift.godbolt.org/z/njz9G6
Neither
-sanitize=address
nor-sanitize=undefined
produce any additional output that could help debug. Turning on optimization doesn't seem to affect the results.The text was updated successfully, but these errors were encountered: