Skip to content

Conversation

@tertsdiepraam
Copy link
Contributor

@tertsdiepraam tertsdiepraam commented Oct 15, 2025

We cannot assume (anymore) that enums, records and prefixes can be compared with memcmp. Doing this would cause Roto to silently do the wrong thing. This PR makes the following changes:

  • Make the type checker more strict about what it allows as arguments of == and !=. Enums and records are no longer allowed. Float var types were missing so those are added.
  • Use the equality function from Rust for Prefix to ensure that the implementation is (and will stay) correct. This also means we don't use the memcmp libcall anymore, which is a nice bonus with regards to Fix musl build of Roto #286
  • Add some methods to Prefix.
  • Enable more tests for Prefix.

This should go into 0.8.1 as it fixes some serious issues. It is a breaking change, but only for cases where Roto would previously miscompile.

@tertsdiepraam tertsdiepraam force-pushed the prefix-eq branch 3 times, most recently from a198e95 to 1168668 Compare October 15, 2025 13:54
@tertsdiepraam tertsdiepraam merged commit 99ebadd into main Oct 15, 2025
14 checks passed
@tertsdiepraam tertsdiepraam deleted the prefix-eq branch October 15, 2025 14:07
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.

1 participant