Fixed hang on large global arrays. Thanks melg8

This commit is contained in:
Jeremiah Orians 2021-06-23 07:32:40 -04:00
parent a925f90c3b
commit 8bc09f2b2e
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
4 changed files with 16 additions and 10 deletions

View File

@ -20,6 +20,7 @@
** Changed
** Fixed
Stop hang on large global arrays
** Removed

View File

@ -1920,6 +1920,15 @@ new_type:
/* length */
size = strtoint(global_token->s);
/* Ensure properly closed */
global_token = global_token->next;
require_match("missing close bracket\n", "]");
require_match("missing ;\n", ";");
/* Stop bad states */
require(size > 0, "Negative values are not supported\n");
require(size < 4096, "M2-Planet is very inefficient so you probably don't want to allocate 4+K bytes into your binary for NULLs\n");
globals_list = emit("\n'", globals_list);
while (0 != size)
{
@ -1928,10 +1937,6 @@ new_type:
}
globals_list = emit("'\n", globals_list);
global_token = global_token->next;
require_match("missing close bracket\n", "]");
require_match("missing ;\n", ";");
goto new_type;
}
/* Add to global symbol table */

View File

@ -179,8 +179,8 @@ fc31fc8b2d78bd50a4c89eb0e29149626868a70842a3dcb01ea87bb275a9e3c2 test/results/t
965bdf7049179199b9f423250a186c7b64ea55326c3249127d2daf7d42ae53cc test/results/test0106-knight-native-binary
0a929d6990caee3e93b1188a38fd3041c6f8e46d25a386024647c0f05c33bce7 test/results/test0106-knight-posix-binary
331ffb5284bd824494ad61a3b0b2dff5681a63ab604e9a06100af531ae237148 test/results/test0106-x86-binary
b059b96414cf326cf211c3b1d63eb01a15924a3c60964ed2e583856715e522fa test/results/test1000-aarch64-binary
c257acf49baa7335f29fd08dcc33986734bb11217b9489f908ec1a46ac228837 test/results/test1000-amd64-binary
0ecdeb7ff165e675d30973906691d02cf2a3a9486d4d3e4da1074e1b8e58dbf7 test/results/test1000-armv7l-binary
423b5e50018d464c62c6a5fc4384cb716f56a07ad434c32e7adc6a4446ebcb4c test/results/test1000-knight-posix-binary
989b624d9a37aae9a92286542d45450775bcbb924667a4e7a975834e5e85050b test/results/test1000-x86-binary
e9d19ffdb968df9acf74803992ddeaeb8cdac0859c376874aff7c511da8152f1 test/results/test1000-aarch64-binary
b7bf60cfdbc7307b012ce37f7db9dce1232742ba2e024727659421ea569cabff test/results/test1000-amd64-binary
eab68643534484930e46a7e80530323cb6846b732ecb01d868cc162c239bf1a6 test/results/test1000-armv7l-binary
75223a8ee5a44debdf45244e3862bdaebae0723c093baa38dd92e91241bbeb0e test/results/test1000-knight-posix-binary
4919f426e681405958ad576c718dcb2fd3ade32e73b367e28c071503485c7475 test/results/test1000-x86-binary

View File

@ -1 +1 @@
1b63f8b58ff8758d46629d57e45c97fc95bab326603107689883ba6aef0a77cc test/test1000/proof
5d15d5c7db17f5341d10f5d459af1bc62b77e60b59ca05aed3d8dbcb920a40f4 test/test1000/proof