#22824 closed task (implemented)

Establish guidelines for using assertions

Reported by: catalyst Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-doc, technical-debt, style
Cc: Actual Points: .1
Parent ID: Points:
Reviewer: Sponsor:

Description

Bugs like #22789 can happen due to overuse of assertions. We should have guidelines for when assertions are appropriate, and document them (probably in CodingStyle.md).

Child Tickets

Change History (4)

comment:1 Changed 23 months ago by nickm

My draft guidelines would be something like "Only use assertions for bugs, never for bad inputs from outside Tor. Always use the least-fatal assertion that makes any sense."

comment:2 Changed 23 months ago by nickm

Oh, and "Only use BUG() inside a conditional."

comment:3 Changed 21 months ago by nickm

Owner: changed from catalyst to nickm
Status: newaccepted

comment:4 Changed 21 months ago by nickm

Actual Points: .1
Resolution: implemented
Status: acceptedclosed

Done in 1502bf03fdf8255d4673cc529e02ad69cef9995d and 8421756da3fc3cc116d17fe96b50384c0d79af8b

Note: See TracTickets for help on using tickets.