Skip to content

Conversation

@aap-sc
Copy link
Collaborator

@aap-sc aap-sc commented Oct 15, 2025

A left shift operation caused an implicit integer promotion, triggering the following UBSan error:

left shift of 254 by 24 places cannot be represented in type 'int'

NOTE: it seems that this code won't work correctly with BE targets, however this is a general problem of the whole implementation anyway.

@aap-sc aap-sc requested review from JanMatCodasip, MarekVCodasip and en-sc and removed request for MarekVCodasip October 15, 2025 18:19
A left shift operation caused an implicit integer promotion, triggering
the following UBSan error:

```
left shift of 254 by 24 places cannot be represented in type 'int'
```

NOTE: it seems that this code won't work correctly with BE targets,
however this is a general problem of the whole implementation anyway.

Signed-off-by: Anatoly Parshintsev <[email protected]>
@aap-sc aap-sc force-pushed the aap-sc/garbage_watchpoint_ub branch from 0d0f743 to 537d22f Compare October 15, 2025 18:21
aap-sc added a commit to syntacore/openocd that referenced this pull request Oct 15, 2025
A left shift operation caused an implicit integer promotion, triggering
the following UBSan error:

```
left shift of 254 by 24 places cannot be represented in type 'int'
```

NOTE: it seems that this code won't work correctly with BE targets,
however this is a general problem of the whole implementation anyway.

See: riscv-collab/riscv-openocd#1299

Signed-off-by: Anatoly Parshintsev <[email protected]>
Copy link
Collaborator

@en-sc en-sc left a comment

Choose a reason for hiding this comment

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

LGTM (reviewed internally).

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