Merge pull request #102 from alliedmodders/fix-map-check
Check for null map in matchtag().
This commit is contained in:
commit
d2c7064e2b
@ -384,7 +384,7 @@ static int matchobjecttags(int formaltag, int actualtag, int flags)
|
|||||||
// Some methodmaps are nullable. The nullable property is inherited
|
// Some methodmaps are nullable. The nullable property is inherited
|
||||||
// automatically.
|
// automatically.
|
||||||
methodmap_t *map = methodmap_find_by_tag(formaltag);
|
methodmap_t *map = methodmap_find_by_tag(formaltag);
|
||||||
if (map->nullable)
|
if (map && map->nullable)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
error(148, pc_tagname(formaltag));
|
error(148, pc_tagname(formaltag));
|
||||||
|
4
sourcepawn/compiler/tests/fail-assign-null-to-any.sp
Normal file
4
sourcepawn/compiler/tests/fail-assign-null-to-any.sp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Foo(any foo) {}
|
||||||
|
public Bar() {
|
||||||
|
Foo(null);
|
||||||
|
}
|
1
sourcepawn/compiler/tests/fail-assign-null-to-any.txt
Normal file
1
sourcepawn/compiler/tests/fail-assign-null-to-any.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
(3) : error 148: cannot assign null to a non-nullable type
|
Loading…
Reference in New Issue
Block a user