WireCmd: error out if "self" is null.

BUG=dawn:34

Change-Id: Ic77a6a1b2145ad9572abd6e2f3cd422d8c87f3eb
Reviewed-on: https://dawn-review.googlesource.com/c/2301
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-11-12 09:01:36 +00:00 committed by Commit Bot service account
parent 284f334398
commit dcc488aa7c
1 changed files with 8 additions and 0 deletions

View File

@ -211,6 +211,14 @@
//* guarantees they are filled even if there is an ID for an error object for the
//* Maybe monad mechanism.
DESERIALIZE_TRY(resolver.GetFromId(record->selfId, &record->self));
//* The object resolver returns a success even if the object is null because the
//* frontend is reponsible to validate that (null objects sometimes have special
//* meanings). However it is never valid to call a method on a null object so we
//* can error out in that case.
if (record->self == nullptr) {
return DeserializeResult::FatalError;
}
{% endif %}
{% if is_struct and as_struct.extensible %}