From bb537d0fcf48a4c28818791e2ba6212c048ef5fa Mon Sep 17 00:00:00 2001 From: hev Date: Sat, 31 Oct 2020 20:16:44 +0800 Subject: [PATCH] Fix IL interpreter build on GCC. (#44049) --- src/coreclr/src/vm/interpreter.cpp | 3 ++- src/coreclr/src/vm/interpreter.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/interpreter.cpp b/src/coreclr/src/vm/interpreter.cpp index ef14373..5fd9830 100644 --- a/src/coreclr/src/vm/interpreter.cpp +++ b/src/coreclr/src/vm/interpreter.cpp @@ -3537,6 +3537,7 @@ bool Interpreter::MethodMayHaveLoop(BYTE* ilCode, unsigned codeSize) op = *(ilCode + 1) + 0x100; _ASSERTE(op < CEE_COUNT); // Bounds check for below. // deliberate fall-through here. + __fallthrough; default: // For the rest of the 1-byte instructions, we'll use a table-driven approach. ilCode += opSizes1Byte[op]; @@ -4919,7 +4920,7 @@ void Interpreter::BinaryIntOpWork(T val1, T val2) { ThrowDivideByZero(); } - else if (val2 == -1 && val1 == static_cast(((UINT64)1) << (sizeof(T)*8 - 1))) // min int / -1 is not representable. + else if (val2 == static_cast(-1) && val1 == static_cast(((UINT64)1) << (sizeof(T)*8 - 1))) // min int / -1 is not representable. { ThrowSysArithException(); } diff --git a/src/coreclr/src/vm/interpreter.h b/src/coreclr/src/vm/interpreter.h index 091a36e..5b1aea0 100644 --- a/src/coreclr/src/vm/interpreter.h +++ b/src/coreclr/src/vm/interpreter.h @@ -1038,7 +1038,7 @@ private: static MethodHandleToInterpMethInfoPtrMap* GetMethodHandleToInterpMethInfoPtrMap(); static InterpreterMethodInfo* RecordInterpreterMethodInfoForMethodHandle(CORINFO_METHOD_HANDLE md, InterpreterMethodInfo* methInfo); - static InterpreterMethodInfo* Interpreter::MethodHandleToInterpreterMethInfoPtr(CORINFO_METHOD_HANDLE md); + static InterpreterMethodInfo* MethodHandleToInterpreterMethInfoPtr(CORINFO_METHOD_HANDLE md); public: static unsigned s_interpreterStubNum; -- 2.7.4