sem: Add constructor nullptr assertions
Catch the nullptrs early. Change-Id: Ie8ee30355c79c6cbd589831f6587752b125d45c0 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49754 Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
parent
a67583cde3
commit
bd7e8442b8
|
@ -22,7 +22,9 @@ namespace tint {
|
||||||
namespace sem {
|
namespace sem {
|
||||||
|
|
||||||
CallTarget::CallTarget(sem::Type* return_type, const ParameterList& parameters)
|
CallTarget::CallTarget(sem::Type* return_type, const ParameterList& parameters)
|
||||||
: return_type_(return_type), parameters_(parameters) {}
|
: return_type_(return_type), parameters_(parameters) {
|
||||||
|
TINT_ASSERT(return_type);
|
||||||
|
}
|
||||||
|
|
||||||
CallTarget::~CallTarget() = default;
|
CallTarget::~CallTarget() = default;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ Expression::Expression(ast::Expression* declaration,
|
||||||
Statement* statement)
|
Statement* statement)
|
||||||
: declaration_(declaration),
|
: declaration_(declaration),
|
||||||
type_(type->UnwrapIfNeeded()),
|
type_(type->UnwrapIfNeeded()),
|
||||||
statement_(statement) {}
|
statement_(statement) {
|
||||||
|
TINT_ASSERT(type_);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sem
|
} // namespace sem
|
||||||
} // namespace tint
|
} // namespace tint
|
||||||
|
|
Loading…
Reference in New Issue