mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-18 13:49:59 +01:00
Ensure functions always have a return even in release builds.
This commit is contained in:
@ -2258,6 +2258,7 @@ static int getNumArguments(const uint8_t* bytecode, const Value* constants,
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -668,7 +668,8 @@ ObjClass* wrenGetClass(WrenVM* vm, Value value)
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL; // Unreachable.
|
||||
UNREACHABLE();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool wrenValuesEqual(Value a, Value b)
|
||||
|
||||
@ -1007,10 +1007,12 @@ static bool runInterpreter(WrenVM* vm)
|
||||
// A CODE_END should always be preceded by a CODE_RETURN. If we get here,
|
||||
// the compiler generated wrong code.
|
||||
UNREACHABLE();
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
ASSERT(0, "Should not reach end of interpret.");
|
||||
// We should only exit this function from an explicit return from CODE_RETURN
|
||||
// or a runtime error.
|
||||
UNREACHABLE();
|
||||
return false;
|
||||
}
|
||||
|
||||
WrenInterpretResult wrenInterpret(WrenVM* vm, const char* sourcePath,
|
||||
|
||||
Reference in New Issue
Block a user