Safe guard InlineAsm-related structs
badumbatish opened this issue · comments
Jasmine Tang commented
The current InlineAsm structs have a lot of constructors where we permit the intialization of nullptr and then we would have to test to see if the pointer is nullptr before performing clone_expr (and not to mention other pointer related operation)
Please preview Arthur's review in this PR.
if
expr
cannot be null then it would be nice to add more assertions to this struct (but in another PR)
- remove the empty constructor, as that will set
expr
tonullptr
and thus create an invalidInOut
- in the full constructor on line 4850,
rust_assert(expr)
to ensure thatexpr
is not null - because
expr
is not null, remove theif (other.expr)
checks in both the copy constructor andoperator=
overload
Originally posted by @CohenArthur in #2982 (comment)