fix: wrap ASSERT in do-while and add UNREACHABLE macro for GCC compatibility

This commit is contained in:
Bob Nystrom
2014-11-28 19:21:01 +00:00
parent 3266491cf5
commit 306c33f01c
3 changed files with 37 additions and 23 deletions
+8 -8
View File
@@ -230,7 +230,7 @@ DEF_NATIVE(fiber_call)
if (runFiber->numFrames == 0) RETURN_ERROR("Cannot call a finished fiber.");
if (runFiber->caller != NULL) RETURN_ERROR("Fiber has already been called.");
// Remember who ran it.
runFiber->caller = fiber;
@@ -1026,22 +1026,22 @@ void wrenInitializeCore(WrenVM* vm)
// The core class diagram ends up looking like this, where single lines point
// to a class's superclass, and double lines point to its metaclass:
//
// __________ /====\
// / \ // \\
// v \ v \\
// .---------. .--------------. //
// | Object |==>| Class |==/
// .------------. .========.
// | | || ||
// v | v ||
// .---------. .--------------. ||
// | Object |==>| Class |==='
// '---------' '--------------'
// ^ ^
// | |
// .---------. .--------------. \
// .---------. .--------------. -.
// | Base |==>| Base.type | |
// '---------' '--------------' |
// ^ ^ | Hypothetical example classes
// | | |
// .---------. .--------------. |
// | Derived |==>| Derived.type | |
// '---------' '--------------' /
// '---------' '--------------' -'
// The rest of the classes can not be defined normally.
vm->boolClass = defineClass(vm, "Bool");