Catch trying to expand nulls

This commit is contained in:
Jeremiah Orians 2021-11-07 00:19:20 -04:00
parent ff65efa99e
commit cdb09b1608
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
3 changed files with 24 additions and 7 deletions

View File

@ -676,14 +676,31 @@ void macro_directive()
struct token_list* maybe_expand(struct token_list* token)
{
if(NULL == token)
{
line_error_token(macro_token);
fputs("maybe_expand passed a null token\n", stderr);
exit(EXIT_FAILURE);
}
struct macro_list* hold = lookup_macro(token);
struct token_list* hold2;
if(NULL == token->next)
{
line_error_token(macro_token);
fputs("we can't expand a null token: ", stderr);
fputs(token->s, stderr);
fputc('\n', stderr);
exit(EXIT_FAILURE);
}
if (NULL == hold)
{
return token->next;
}
token = eat_token(token);
if (NULL == hold->expansion)
{
return token->next;

View File

@ -212,9 +212,9 @@ eb1f6aab09a1a4966f9f49a518d8aa03ca97aa7c46e443871d758a306671a85e test/results/t
a2cbfd5f76d3be8049c6737e3fa02f191caf29b6885db006fa23f86e6eacc186 test/results/test0106-knight-posix-binary
d75e450e2fcdf19df63f9d6a3fe5e032933e57b33f6f06b39a8ed2f3dc759f17 test/results/test0106-riscv64-binary
473cc504d6cba9eaf648abcf15c83a317ff3f4a7f08f5e8936e3b35b2cc4fbc6 test/results/test0106-x86-binary
616f562b698c79058a0c09e226425a1f512d45aa046ddc9ac55ae369d5bc36f5 test/results/test1000-aarch64-binary
3e5148fed11d7b594682de9df95d9cccf8f139a3811d27ff3eec950ad8ad2feb test/results/test1000-amd64-binary
a4e076fbf83103e2ebc7b4845f259bc985ec085b5da21bf505ce6d305c639c72 test/results/test1000-armv7l-binary
0adab974e95a042dec050b90f587b18677e5a96360b97f5a9126c3ecd0773ba9 test/results/test1000-knight-posix-binary
bf420ce5489490749f6f0048210c48336e2ff37d580991eba36569ff26638aa8 test/results/test1000-riscv64-binary
27d4dd3ee26f45fdd70ad30dfb5816d7d27c9060e485869e966b959b8587ae41 test/results/test1000-x86-binary
e522d09df1cda744211227804480a7aeb0247c89747654370887fc4f6a032613 test/results/test1000-aarch64-binary
7f4dbf8f2fc07691cb3d30dcc3e6e70d883b5a2ab85dda29f91bc637eb6d92a1 test/results/test1000-amd64-binary
fa5e030d6fb4a4e4046f1b0f31dd88583c0b12d87197ccaedcda74e489447e47 test/results/test1000-armv7l-binary
0076fcb91f8cf1fa6380ee32e2116a46f4228fb1ca7ae7e070c5153ec6aaa15c test/results/test1000-knight-posix-binary
e0e666234912c7f8c1a19a0988de448b58a4bde5c1d130630f5289e88e48ff31 test/results/test1000-riscv64-binary
d8179b2b222a14c08d97d2839b9b6cac947c3c092d0b0d9bf788593fe1dd5257 test/results/test1000-x86-binary

View File

@ -1 +1 @@
4ec7d9bdd81261c9262d257cb6967499bfab1933f71623e74ae134f34d69f908 test/test1000/proof
51e808077053d16e4bc907b32377a3b2ced993809d5921c8fa9793435bca18a5 test/test1000/proof