mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
fix #20972 fixes invalid and UB codegen case object transitions for both refc and ORC [backport] (#21611)
fix #20972 fixes invalid and UB codegen case object transitions for refc and ORC
This commit is contained in:
@@ -275,10 +275,12 @@ proc genericReset(dest: pointer, mt: PNimType) =
|
||||
|
||||
proc selectBranch(discVal, L: int,
|
||||
a: ptr array[0x7fff, ptr TNimNode]): ptr TNimNode =
|
||||
result = a[L] # a[L] contains the ``else`` part (but may be nil)
|
||||
if discVal <% L:
|
||||
let x = a[discVal]
|
||||
if x != nil: result = x
|
||||
result = a[discVal]
|
||||
if result == nil:
|
||||
result = a[L]
|
||||
else:
|
||||
result = a[L] # a[L] contains the ``else`` part (but may be nil)
|
||||
|
||||
proc FieldDiscriminantCheck(oldDiscVal, newDiscVal: int,
|
||||
a: ptr array[0x7fff, ptr TNimNode],
|
||||
|
||||
Reference in New Issue
Block a user