File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -166,8 +166,7 @@ export class Compilation {
166166 out . push ( `case ${ name } :` ) ;
167167 out . push ( `${ LABEL_PREFIX } ${ name } : {` ) ;
168168 lines . forEach ( ( line ) => out . push ( ` ${ line } ` ) ) ;
169- out . push ( ' /* UNREACHABLE */;' ) ;
170- out . push ( ' abort();' ) ;
169+ out . push ( ' UNREACHABLE;' ) ;
171170 out . push ( '}' ) ;
172171 } ) ;
173172 }
@@ -179,8 +178,7 @@ export class Compilation {
179178 }
180179 out . push ( `${ LABEL_PREFIX } ${ name } : {` ) ;
181180 lines . forEach ( ( line ) => out . push ( ` ${ line } ` ) ) ;
182- out . push ( ' /* UNREACHABLE */;' ) ;
183- out . push ( ' abort();' ) ;
181+ out . push ( ' UNREACHABLE;' ) ;
184182 out . push ( '}' ) ;
185183 } ) ;
186184 }
Original file line number Diff line number Diff line change @@ -61,8 +61,10 @@ export class CCompiler {
6161
6262 out . push ( '#ifdef _MSC_VER' ) ;
6363 out . push ( ' #define ALIGN(n) _declspec(align(n))' ) ;
64+ out . push ( ' #define UNREACHABLE __assume(0)' ) ;
6465 out . push ( '#else /* !_MSC_VER */' ) ;
6566 out . push ( ' #define ALIGN(n) __attribute__((aligned(n)))' ) ;
67+ out . push ( ' #define UNREACHABLE __builtin_unreachable()' ) ;
6668 out . push ( '#endif /* _MSC_VER */' ) ;
6769
6870 out . push ( '' ) ;
@@ -103,8 +105,7 @@ export class CCompiler {
103105 compilation . indent ( out , tmp , ' ' ) ;
104106
105107 out . push ( ' default:' ) ;
106- out . push ( ' /* UNREACHABLE */' ) ;
107- out . push ( ' abort();' ) ;
108+ out . push ( ' UNREACHABLE;' ) ;
108109 out . push ( ' }' ) ;
109110
110111 tmp = [ ] ;
You can’t perform that action at this time.
0 commit comments