Skip to content

Fix potential panic in ConstraintTrace display formatting#411

Open
anim001k wants to merge 1 commit into
arkworks-rs:masterfrom
anim001k:master
Open

Fix potential panic in ConstraintTrace display formatting#411
anim001k wants to merge 1 commit into
arkworks-rs:masterfrom
anim001k:master

Conversation

@anim001k

Copy link
Copy Markdown

Problem

The fmt::Display implementation for ConstraintTrace used metadata.module_path().unwrap(), which could panic if the module path is not available for certain spans (e.g., from macros or external sources).

Solution

Replace unwrap() with unwrap_or(metadata.target()) to provide a safe fallback using the span's target as an alternative identifier.

Changes

  • File: relations/src/gr1cs/trace.rs
  • Line: 310
  • Before: metadata.module_path().unwrap()
  • After: metadata.module_path().unwrap_or(metadata.target())

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.

1 participant