← Back to Pull requests

boot: bootutil: Change assert() calls to ASSERT() #2789

Open
nordicjm opened this pull request with 264 lines diff across 11 files
View on GitHub
nordicjm nordicjm commented on Jul 14, 2026 13:31 UTC
Author

MCUboot has an assert handler macro which is used from the simulator, align usage of assert calls to match it

Diff: 264 lines (+132 / -132) across 11 files Reviewer: d3zd3z Review duration: 145461m
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.58) × (1 − Review Confidence (0.86)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.58 · 264 lines diff across 11 files
0.58
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.85 · 1 substantive comment(s)
0.85
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
85%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.334
Real PR Conversation Timeline
3 items
d3zd3z d3zd3z approved these changes on Jul 15, 2026 22:39 UTC
Approved Reviewer

One problem with assert is that it can be compiled out. For security, that can really never be the case. Does ASSERT have this property? Otherwise, looks good.

nordicjm nordicjm commented on Jul 16, 2026 07:17 UTC
Author

One problem with assert is that it can be compiled out. For security, that can really never be the case. Does ASSERT have this property? Otherwise, looks good.

It's a macro you defined :) so there is this for all targets: https://github.com/mcu-tools/mcuboot/blob/74f4d64172601f14d1dc7e3f98a187fba66a56cb/boot/bootutil/include/bootutil/bootutil_public.h#L145 which does also allow using a custom assert, and the simulator uses this: https://github.com/mcu-tools/mcuboot/blob/74f4d64172601f14d1dc7e3f98a187fba66a56cb/sim/mcuboot-sys/csupport/mcuboot_config/mcuboot_assert.h#L25 which is important for the simulator as it needs to be able to _catch_ asserts for some tests rather than the rust executable dying at that point due to the assert() call, so for simulator this fixes this, for all other platforms there is no difference at all (unless they want a custom assert handler, in which case this would fix that also)

Reviewers
Assignees
nordicjm nordicjm
Labels
risk: low confidence: 85.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 58% (MEDIUM) · Higher = larger blast radius
58%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 85.5% · Lower = rushed or shallow review
85.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 8.4% · Safe to merge
8.4%