fix: restructure REPL loop to eliminate unreachable code after fgets failure

The original REPL loop had an if-else structure where the else branch (handling fgets failure) contained a return statement, making the code after the if-else block unreachable. This commit restructures the loop by inverting the condition: when fgets fails, the loop breaks instead of returning, allowing the subsequent wrenFreeVM call to execute. Additionally, enables CLANG_WARN_UNREACHABLE_CODE in both Debug and Release Xcode build configurations to catch similar issues in the future.
This commit is contained in:
Bob Nystrom
2015-03-22 17:26:54 +00:00
parent 295a408858
commit 4343b95c04
2 changed files with 9 additions and 9 deletions
@@ -269,6 +269,7 @@
29AB1F101816E3AD004B501E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_UNREACHABLE_CODE = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_PEDANTIC = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -278,6 +279,7 @@
29AB1F111816E3AD004B501E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_UNREACHABLE_CODE = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_PEDANTIC = NO;
PRODUCT_NAME = "$(TARGET_NAME)";