Workaround issue with Box.unbox causing segfault

Using Box.unbox on a nil value with a union type causes:

Invalid memory access (signal 11) at address 0x8

Related Crystal issue: https://github.com/crystal-lang/crystal/issues/11839
Fixes: https://gitlab.com/arctic-fox/spectator/-/issues/76
This commit is contained in:
Michael Miller 2022-07-18 19:47:34 -06:00
parent 95764140ee
commit 18e9c1c35d
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
3 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,6 @@
require "../spec_helper"
Spectator.describe "GitLab Issue #76" do
let(:value) { nil.as(Int32?) }
specify { expect(value).to be_nil }
end