Skip to content

vam: fix panic in upcast()#7006

Merged
nwt merged 4 commits into
mainfrom
vam-upcast-panic
Jun 2, 2026
Merged

vam: fix panic in upcast()#7006
nwt merged 4 commits into
mainfrom
vam-upcast-panic

Conversation

@nwt
Copy link
Copy Markdown
Member

@nwt nwt commented May 28, 2026

runtime/vam/expr/function.Upcast.deunionAndUpcast does not change the type of zero-length vectors. This causes trouble because the vectors passed to vbuild.MergeSameTypesInDynamic then have multiple types, causing that function to return a vector.Dynamic instead of the expected vector with the target type. Fix by changing the type of zero-length
vectors to the target type in deunionAndUpcast.

runtime/vam/expr/function.Upcast.deunionAndUpcast does not change the
type of zero-length vectors.  This causes trouble because the vectors
passed to vbuild.MergeSameTypesInDynamic then have multiple types,
causing that function to return a vector.Dynamic instead of the expected
vector with the target type.  Fix by changing the type of zero-length
vectors to the target type in deunionAndUpcast and then skipping
zero-length vectors in vbuild.Merge.
@nwt nwt requested a review from a team May 28, 2026 22:25
@nwt nwt marked this pull request as draft May 29, 2026 17:43
@nwt nwt marked this pull request as ready for review June 2, 2026 16:36
@nwt nwt merged commit 294cc78 into main Jun 2, 2026
2 checks passed
@nwt nwt deleted the vam-upcast-panic branch June 2, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants