Skip to content

Decouple functions from fields namespace - #2

Merged
darsto2 merged 1 commit into
masterfrom
feat/decouple-field-fn-names
Jun 25, 2026
Merged

Decouple functions from fields namespace#2
darsto2 merged 1 commit into
masterfrom
feat/decouple-field-fn-names

Conversation

@darsto2

@darsto2 darsto2 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Surprisingly fields and functions share a namespace. There can't
be a function called "len" if a field "len" is also present.
This happens exactly in hyperion. ElfMmapEvent has a len field,
so registering a function fails there.

It's a footgun. Luckily with a simple fix.
Put function and field names in separate lookup maps. The lexer
knows to use the function lookup map if the name is followed by (.

Surprisingly fields and functions share a namespace. There can't
be a function called "len" if a field "len" is also present.
This happens exactly in hyperion. ElfMmapEvent has a len field,
so registering a function fails there.

It's a footgun. Luckily with a simple fix.
Put function and field names in separate lookup maps. The lexer
knows to use the function lookup map if the name is followed by (.
@darsto2
darsto2 requested a review from ted-gould June 25, 2026 10:51
@darsto2

darsto2 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

CI fails on lint and whatnot but I tested this with hyperion

@ted-gould ted-gould left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see anything wrong with the code. But, is there a test suite we could add to? Seems like that'd help for these type of fixes.

@darsto2

darsto2 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Yeah I agree. I'm adding some unit tests in hyperion but wirefilter could use them too. I'll have to add them if I ever get to upstream this

@darsto2
darsto2 merged commit fe92034 into master Jun 25, 2026
5 of 11 checks passed
@darsto2
darsto2 deleted the feat/decouple-field-fn-names branch June 25, 2026 14:37
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