Skip to content

Commit bf5ac8c

Browse files
authored
[Serializer] make sure to set CodeInfo.ssaflags correctly (#42177)
Makes sure the length of `ssaflags` matches that of `code`, so that the latest inference doesn't throw on IRs serialized from old versions. Ref: <#42149 (comment)>
1 parent bea33d6 commit bf5ac8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stdlib/Serialization/src/Serialization.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,13 @@ function deserialize(s::AbstractSerializer, ::Type{CodeInfo})
11351135
ci.ssavaluetypes = deserialize(s)
11361136
ci.linetable = deserialize(s)
11371137
end
1138-
ci.ssaflags = deserialize(s)
1138+
ssaflags = deserialize(s)
1139+
if length(ssaflags) length(code)
1140+
# make sure the length of `ssaflags` matches that of `code`
1141+
# so that the latest inference doesn't throw on IRs serialized from old versions
1142+
ssaflags = UInt8[0x00 for _ in 1:length(code)]
1143+
end
1144+
ci.ssaflags = ssaflags
11391145
if pre_12
11401146
ci.slotflags = deserialize(s)
11411147
else

0 commit comments

Comments
 (0)