mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-24 14:45:00 -07:00
Add extra error checks
This commit is contained in:
@@ -1999,6 +1999,10 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (any_errors()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
temp_allocator_free_all(&temporary_allocator_data);
|
||||
|
||||
timings_start_section(timings, str_lit("type check"));
|
||||
@@ -2013,6 +2017,9 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
if (checked_inited) {
|
||||
check_parsed_files(&checker);
|
||||
}
|
||||
if (any_errors()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
temp_allocator_free_all(&temporary_allocator_data);
|
||||
|
||||
|
||||
@@ -250,6 +250,10 @@ gb_global ErrorCollector global_error_collector;
|
||||
#define MAX_ERROR_COLLECTOR_COUNT (36)
|
||||
|
||||
|
||||
bool any_errors(void) {
|
||||
return global_error_collector.error_buffer.count > 0;
|
||||
}
|
||||
|
||||
void init_global_error_collector(void) {
|
||||
gb_mutex_init(&global_error_collector.mutex);
|
||||
array_init(&global_error_collector.errors, heap_allocator());
|
||||
|
||||
Reference in New Issue
Block a user