Ver código fonte

Exit program if there were syntax errors

Ginger Bill 8 anos atrás
pai
commit
c69df7cd3a
2 arquivos alterados com 6 adições e 2 exclusões
  1. 4 0
      src/checker.c
  2. 2 2
      src/ir.c

+ 4 - 0
src/checker.c

@@ -714,6 +714,10 @@ void destroy_checker_info(CheckerInfo *i) {
 
 
 void init_checker(Checker *c, Parser *parser, BuildContext *bc) {
+	if (global_error_collector.count > 0) {
+		gb_exit(1);
+	}
+
 	gbAllocator a = heap_allocator();
 
 	c->parser = parser;

+ 2 - 2
src/ir.c

@@ -1596,8 +1596,8 @@ irValue *ir_gen_map_key(irProcedure *proc, irValue *key, Type *key_type) {
 		irValue *bits = NULL;
 		i64 size = type_size_of(proc->module->allocator, t);
 		switch (8*size) {
-		case 32: bits = ir_emit_bitcast(proc, key, t_u32); break;
-		case 64: bits = ir_emit_bitcast(proc, key, t_u64); break;
+		case 32: bits = ir_emit_transmute(proc, key, t_u32); break;
+		case 64: bits = ir_emit_transmute(proc, key, t_u64); break;
 		default: GB_PANIC("Unhandled float size: %lld bits", size); break;
 		}