Skip to content

Commit

Permalink
Merge pull request #3595 from rwy0717/bad-cast-to-ptr
Browse files Browse the repository at this point in the history
Explicitly widen the source immediate before casting to pointer
  • Loading branch information
0xdaryl authored Feb 26, 2019
2 parents ca1b179 + e0ef1a4 commit dba8966
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler/x/codegen/X86BinaryEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ TR::X86ImmInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)symbolKind,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -1136,7 +1136,7 @@ TR::X86ImmSymInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)TR::SymbolType::typeClass,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -1567,7 +1567,7 @@ TR::X86RegImmInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)symbolKind,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -1692,7 +1692,7 @@ TR::X86RegImmSymInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)TR::SymbolType::typeClass,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -1735,7 +1735,7 @@ TR::X86RegImmSymInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)symbolKind,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -1987,7 +1987,7 @@ TR::X86MemImmInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)TR::SymbolType::typeClass,
TR_SymbolFromManager,
cg()),
Expand Down Expand Up @@ -2149,7 +2149,7 @@ TR::X86MemImmSymInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
if (cg()->comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
(uint8_t *)getSourceImmediate(),
(uint8_t *)(uintptr_t)getSourceImmediate(),
(uint8_t *)TR::SymbolType::typeClass,
TR_SymbolFromManager,
cg()),
Expand Down

0 comments on commit dba8966

Please sign in to comment.