Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove "inout" for type reference, fix for Zeek v7 / Spicy v1.11.0 #5

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

mmguero
Copy link
Contributor

@mmguero mmguero commented Aug 6, 2024

fix for unsupported type for unit parameter 'cfgFrag': type of inout unit parameters must itself be a unit; for other parameter types, use references instead of inout

explanation from @bbannier on Slack:

The technical reason this works is that references in Spicy already provide mutable access to the wrapped data (interior mutability). Having an inout on a reference parameter would seem to mean “function can reseat this reference”, but we do not provide that.

Tested after my fix:

zkg install https://github.com/mmguero-dev/icsnpp-profinet-io-cm
The following packages will be INSTALLED:
  https://github.com/mmguero-dev/icsnpp-profinet-io-cm (main)

Proceed? [Y/n] y
Running unit tests for "https://github.com/mmguero-dev/icsnpp-profinet-io-cm"
Installing "https://github.com/mmguero-dev/icsnpp-profinet-io-cm"..................................
Installed "https://github.com/mmguero-dev/icsnpp-profinet-io-cm" (main)
Loaded "https://github.com/mmguero-dev/icsnpp-profinet-io-cm"

…f inout unit parameters must itself be a unit; for other parameter types, use references instead of inout"

explanation from Benjamin Bannier: "The technical reason this works is that references in Spicy already provide mutable access to the wrapped data (interior mutability). Having an inout on a reference parameter would seem to mean “function can reseat this reference”, but we do not provide that."

This will hopefully make the parser build with the latest spicy release
@mmguero mmguero changed the title fix for Zeek v7 / Spicy v1.11.0 remove "inout" for type reference, fix for Zeek v7 / Spicy v1.11.0 Aug 6, 2024
@kkvarfordt kkvarfordt merged commit 98bba96 into cisagov:main Aug 6, 2024
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