From ed61a97d9f4ff8b57318f868f1abcd92d6ce0bd3 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 23 Sep 2021 15:56:12 -0400 Subject: [PATCH] refactor: Move VLA to handle clang-12 error --- runtime/src/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/module.c b/runtime/src/module.c index 4b5a66d..5bde615 100644 --- a/runtime/src/module.c +++ b/runtime/src/module.c @@ -230,7 +230,8 @@ int module_new_from_json(char *file_name) { assert(file_name != NULL); - int return_code = -1; + int return_code = -1; + jsmntok_t tokens[JSON_MAX_ELEMENT_SIZE * JSON_MAX_ELEMENT_COUNT]; /* Use stat to get file attributes and make sure file is present and not empty */ struct stat stat_buffer; @@ -282,7 +283,6 @@ module_new_from_json(char *file_name) /* Initialize the Jasmine Parser and an array to hold the tokens */ jsmn_parser module_parser; jsmn_init(&module_parser); - jsmntok_t tokens[JSON_MAX_ELEMENT_SIZE * JSON_MAX_ELEMENT_COUNT]; /* Use Jasmine to parse the JSON */ int total_tokens = jsmn_parse(&module_parser, file_buffer, total_chars_read, tokens,