Re-land: [FIRRTL][CAPI] Add more functions for discriminating and querying type #7972
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re-push #7960, closes #7970.
In #7960, I used
memcmp
for comparing 2struct FIRRTLBundleField
, this is problematic and may return unexpected results since 2MlirXXX
different opaque pointer structs may be the same content.After replacing it with function
bundleFieldEqual
above, it should be correct and the crash no longer occurs on Windows, and Valgrind no longer reportsConditional jump or move depends on uninitialised value(s)
. The uninitialized memory error from Valgrind could be becausememcmp
accessed struct padding, but I'm confused as to why Windows reports it as 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN
). 😶🌫️