Skip to content

Assert validation with string literals is always true #30109

@ubyte

Description

@ubyte

When a constant string literal is erroneously passed to one of the ASSERT, ABORT, VERIFY or ENSURE macros, it is silently converted to 'true', resulting in the check being skipped completely.

Example

switch (version) {
  case 1: return HandleV1();
  case 2: return HandleV2();
  default: Y_ESNURE("Unsupported version"); // exception never raised
}

related: IGNIETFERRO-2168

codesearch results: https://nda.ya.ru/t/n6pl7isS7PSQuR

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions