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

[BUG] Anonymous union initialized using 'from_bytes' in some cases #447 #467

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

alexey-utkin
Copy link
Collaborator

No description provided.

@alexey-utkin alexey-utkin linked an issue Sep 16, 2022 that may be closed by this pull request
@alexey-utkin alexey-utkin linked an issue Sep 16, 2022 that may be closed by this pull request
@@ -1825,7 +1825,8 @@ namespace {
[] (const tests::Tests::MethodTestCase& testCase) {
return stoi(testCase.paramValues[0].view->getEntryValue(nullptr)) ==
stoi(testCase.paramValues[1].view->getEntryValue(nullptr)) &&
testCase.returnValue.view->getEntryValue(nullptr) == "{{{'k', 1.010100e+00}}}";
StringUtils::startsWith(testCase.returnValue.view->getEntryValue(nullptr),
"{from_bytes<StructWithStructInUnion::DeepUnion>({");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can get the from_bytes init expression, if there is no the single field init strategy.
That is the case of in alignment bytes garbage like a case

union A {
    struct {
        char c;
        int hiInt;    
    }
    int lowInt;
}

no way to repeat the state in initializer for a state after a.lowInt = 0x0001; a.hiInt = 0x01;.

@alexey-utkin alexey-utkin marked this pull request as ready for review September 18, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] Anonymous union initialized using 'from_bytes' in some cases
2 participants