Check for null map in matchtag().

This commit is contained in:
David Anderson
2014-07-20 10:15:49 -07:00
parent 8436a3ea6c
commit 4051756576
3 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -384,7 +384,7 @@ static int matchobjecttags(int formaltag, int actualtag, int flags)
// Some methodmaps are nullable. The nullable property is inherited
// automatically.
methodmap_t *map = methodmap_find_by_tag(formaltag);
if (map->nullable)
if (map && map->nullable)
return TRUE;
error(148, pc_tagname(formaltag));
@@ -0,0 +1,4 @@
Foo(any foo) {}
public Bar() {
Foo(null);
}
@@ -0,0 +1 @@
(3) : error 148: cannot assign null to a non-nullable type