diff --git a/src/coreclr/interpreter/intops.h b/src/coreclr/interpreter/intops.h index 334242321d96d5..6886400ac35fe0 100644 --- a/src/coreclr/interpreter/intops.h +++ b/src/coreclr/interpreter/intops.h @@ -98,7 +98,7 @@ inline int32_t getI4LittleEndian(const uint8_t* ptr) inline int64_t getI8LittleEndian(const uint8_t* ptr) { - return (int64_t)getI4LittleEndian(ptr) | ((int64_t)getI4LittleEndian(ptr + 4)) << 32; + return (int64_t)getU4LittleEndian(ptr) | ((int64_t)getI4LittleEndian(ptr + 4)) << 32; } inline float getR4LittleEndian(const uint8_t* ptr) diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index 15d91a4cf5398c..e03a8870676c10 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -143,7 +143,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr ip += 2; break; case INTOP_LDC_I8: - LOCAL_VAR(ip[1], int64_t) = (int64_t)ip[2] + ((int64_t)ip[3] << 32); + LOCAL_VAR(ip[1], int64_t) = (int64_t)(uint32_t)ip[2] + ((int64_t)ip[3] << 32); ip += 4; break; case INTOP_LDC_R4: @@ -151,7 +151,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr ip += 3; break; case INTOP_LDC_R8: - LOCAL_VAR(ip[1], int64_t) = (int64_t)ip[2] + ((int64_t)ip[3] << 32); + LOCAL_VAR(ip[1], int64_t) = (int64_t)(uint32_t)ip[2] + ((int64_t)ip[3] << 32); ip += 4; break; case INTOP_LDPTR: