[std.regex] Fix unsafe casts to bool

These are disallowed in `@safe` code with
https://github.com/dlang/dmd/pull/16558.
This commit is contained in:
Nick Treleaven 2024-06-03 14:26:46 +01:00 committed by The Dlang Bot
parent 45f7b06842
commit ccd3115b8b

View file

@ -318,7 +318,7 @@ struct Bytecode
@property bool backreference() const
{
assert(code == IR.GroupStart || code == IR.GroupEnd);
return cast(bool)(raw & 1 << 23);
return (raw & 1 << 23) != 0;
}
//mark as local reference (for backrefs in lookarounds)
@ -332,7 +332,7 @@ struct Bytecode
@property bool localRef() const
{
assert(code == IR.Backref);
return cast(bool)(raw & 1 << 23);
return (raw & 1 << 23) != 0;
}
//human readable name of instruction