diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-11 15:54:33 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-11 15:54:33 +0000 |
| commit | 2b83f27f065d2805e149da23fb1d3c766889491d (patch) | |
| tree | d9c23dfeda4063c075adc5296fc410d466e8bf43 /src/check_builtin.cpp | |
| parent | 22840ddf9769c47f8ac0f68b5b12f75200229bd9 (diff) | |
| parent | 3d0e19429818781882deca35df730b3766bade5d (diff) | |
Merge branch 'master' into map-dev
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 890f7a39b..031ef1218 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -4182,6 +4182,13 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 return false; } + Type *elem = type_deref(ptr0.type); + if (type_size_of(elem) == 0) { + gbString str = type_to_string(ptr0.type); + error(ptr0.expr, "Expected a pointer to a non-zero sized element for '%.*s', got %s", LIT(builtin_name), str); + gb_string_free(str); + return false + } } break; |