Skip to content

Conversation

wbruna
Copy link
Contributor

@wbruna wbruna commented Aug 31, 2025

  • the value of the parameter eta was undefined

  • replace memset calls on parameter struct initializations with simpler initialization lists

  • add a missing free on an error path in the context initialization

@Green-Sky
Copy link
Contributor

Memsetting some types is undefined or implementation defined behavior and should be avoided. Since this is kinda c++, wouldn't something like *sample_params = {}; work better?

@wbruna
Copy link
Contributor Author

wbruna commented Aug 31, 2025

It is less of an issue for these parameter structs, though, since they are supposed to be C-compatible. But I fully agree type-safe initializations would be better; I just followed the way the other init functions are doing it.

Edit: replaced the memsets, and rebased onto master.

@wbruna wbruna force-pushed the wan_fix_params_init branch from 1c02c33 to 20dbf21 Compare August 31, 2025 12:48
* the value of the parameter eta was undefined

* replace memset calls on parameter struct initializations
with simpler initialization lists

* add a missing free on an error path in the context
initialization
@wbruna wbruna force-pushed the wan_fix_params_init branch from 20dbf21 to 02de7c8 Compare September 7, 2025 01:49
@wbruna wbruna changed the base branch from wan to master September 7, 2025 01:50
@wbruna wbruna changed the title fix sample params initialization fix: missing initialization of sample parameters Sep 7, 2025
@leejet leejet merged commit ac5a215 into leejet:master Sep 10, 2025
@leejet
Copy link
Owner

leejet commented Sep 10, 2025

Thank you for your contribution.

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.

3 participants