summaryrefslogtreecommitdiff
path: root/src/ilasm
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2016-01-04 13:37:08 -0800
committerKyungwoo Lee <kyulee@microsoft.com>2016-01-04 14:11:27 -0800
commitbc7a2bd9fe8c389a3b622a1456e10a7ed606f9dd (patch)
tree13912d305dbf928726354c6b5b2351a823ab910d /src/ilasm
parent85f256e9b41cac20834d9695675e3ac8694454f9 (diff)
downloadcoreclr-bc7a2bd9fe8c389a3b622a1456e10a7ed606f9dd.tar.gz
coreclr-bc7a2bd9fe8c389a3b622a1456e10a7ed606f9dd.tar.bz2
coreclr-bc7a2bd9fe8c389a3b622a1456e10a7ed606f9dd.zip
Fix bad-codegen from ilasm
Switch target should be 4 byte instead of 8 byte. In Windows, size of long is same as size of int which is 4 byte, but this is 8 byte in Unix.
Diffstat (limited to 'src/ilasm')
-rw-r--r--src/ilasm/assembler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ilasm/assembler.cpp b/src/ilasm/assembler.cpp
index 2398ba92f6..a027a10620 100644
--- a/src/ilasm/assembler.cpp
+++ b/src/ilasm/assembler.cpp
@@ -2105,7 +2105,7 @@ void Assembler::EmitInstrSwitch(Instr* instr, Labels* targets)
Labels *pLbls;
int NumLabels;
Label *pLabel;
- long offset;
+ UINT offset;
EmitOpcode(instr);
@@ -2134,10 +2134,10 @@ void Assembler::EmitInstrSwitch(Instr* instr, Labels* targets)
}
else
{
- offset = (long)(UINT_PTR)pLbls->Label;
+ offset = (UINT)(UINT_PTR)pLbls->Label;
if (m_fDisplayTraceOutput) report->msg("%d\n", offset);
}
- EmitBytes((BYTE *)&offset, sizeof(long));
+ EmitBytes((BYTE *)&offset, sizeof(UINT));
}
delete targets;
}