Skip to content

fix runtime asan error due to storing to and reading from misaligned address#945

Merged
bjornbytes merged 1 commit into
bjornbytes:devfrom
TylkoKuba:data_blob_asan
May 20, 2026
Merged

fix runtime asan error due to storing to and reading from misaligned address#945
bjornbytes merged 1 commit into
bjornbytes:devfrom
TylkoKuba:data_blob_asan

Conversation

@TylkoKuba
Copy link
Copy Markdown
Contributor

local blob = lovr.data.newBlob(3)
blob:setU8(0, 0)
blob:setU16(1, 0)
blob:getU8(0)
blob:getU16(1)

Results in
runtime error: store to misaligned address [...] for type 'uint16_t' (aka 'unsigned short'), which requires 2 byte alignment
and
runtime error: load of misaligned address [...] for type 'const uint16_t' (aka 'const unsigned short'), which requires 2 byte alignment

@TylkoKuba TylkoKuba changed the title fix runtime asan error due to storing to misaligned address fix runtime asan error due to storing to and reading from misaligned address May 20, 2026
@bjornbytes
Copy link
Copy Markdown
Owner

Thanks!

@bjornbytes bjornbytes merged commit fa65268 into bjornbytes:dev May 20, 2026
5 of 6 checks passed
@TylkoKuba TylkoKuba deleted the data_blob_asan branch May 21, 2026 06:19
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.

2 participants