Skip to content

Value-initialize WithReturnValue::retval in script/arg-packs.h. - #344

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/994606927
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/994606927

Conversation

@copybara-service

Copy link
Copy Markdown

Value-initialize WithReturnValue::retval in script/arg-packs.h.

For scalar Retval types such as bool (used by Equal, Verify, Isomorphic, Equivalent, RandEquivalent, TopSort, FarEqual, FarIsomorphic, Compress, and Decompress), WithReturnValue::retval was left uninitialized on construction. When Apply fails to find a registered operation on the given arc type in non-fatal mode (--fst_error_fatal=false), it returns without invoking the operation and callers read an uninitialized retval.

Value-initialize Retval retval{}; in WithReturnValue (script/arg-packs.h).

For scalar `Retval` types such as `bool` (used by `Equal`, `Verify`, `Isomorphic`, `Equivalent`, `RandEquivalent`, `TopSort`, `FarEqual`, `FarIsomorphic`, `Compress`, and `Decompress`), `WithReturnValue::retval` was left uninitialized on construction. When `Apply` fails to find a registered operation on the given arc type in non-fatal mode (`--fst_error_fatal=false`), it returns without invoking the operation and callers read an uninitialized `retval`.

Value-initialize `Retval retval{};` in `WithReturnValue` (`script/arg-packs.h`).

PiperOrigin-RevId: 994606927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant