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

Make variables volatile in get_blob_* functions #251

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

danielinux
Copy link
Member

Compiler optimizations will cause some values to be optimized out, when reading parameters from the flash.

Using 'volatile' in these functions results in values being correctly updated.
This should fix the issue reported in #249 .

Compiler optimizations will cause some values to be optimized out, when
reading parameters from the flash.

Using 'volatile' in these functions results in values being correctly
updated.

This should fix the issue reported in wolfSSL#249.
@@ -574,7 +574,7 @@ int wolfBoot_get_delta_info(uint8_t part, int inverse, uint32_t **img_offset,

uint32_t wolfBoot_get_blob_version(uint8_t *blob)
{
uint32_t *version_field = NULL;
uint32_t *volatile version_field = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Syntax format is usually volatile uint32_t* version_field = NULL;. Can you update these?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry about that. I see now it is the pointer that you want to be volatile.

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.

None yet

2 participants