Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit cc5b241

Browse files
authored
Fix build with Clang 13 (#63314) (#28232)
1 parent 75543e2 commit cc5b241

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/inc/corhlpr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ struct COR_ILMETHOD_SECT
335335
const COR_ILMETHOD_SECT* Next() const
336336
{
337337
if (!More()) return(0);
338-
return ((COR_ILMETHOD_SECT*)(((BYTE *)this) + DataSize()))->Align();
338+
return ((COR_ILMETHOD_SECT*)Align(((BYTE *)this) + DataSize()));
339339
}
340340

341341
const BYTE* Data() const
@@ -373,9 +373,9 @@ struct COR_ILMETHOD_SECT
373373
return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);
374374
}
375375

376-
const COR_ILMETHOD_SECT* Align() const
376+
static const void* Align(const void* p)
377377
{
378-
return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3));
378+
return((void*) ((((UINT_PTR) p) + 3) & ~3));
379379
}
380380

381381
protected:
@@ -578,7 +578,7 @@ typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT
578578

579579
const COR_ILMETHOD_SECT* GetSect() const {
580580
if (!More()) return (0);
581-
return(((COR_ILMETHOD_SECT*) (GetCode() + GetCodeSize()))->Align());
581+
return(((COR_ILMETHOD_SECT*) COR_ILMETHOD_SECT::Align(GetCode() + GetCodeSize())));
582582
}
583583
} COR_ILMETHOD_FAT;
584584

src/jit/bitsetasshortlong.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class BitSetOps</*BitSetType*/ BitSetShortLongRep,
346346
{
347347
if (IsShort(env))
348348
{
349-
(size_t&)out = (size_t)out & ((size_t)gen | (size_t)in);
349+
out = (BitSetShortLongRep)((size_t)out & ((size_t)gen | (size_t)in));
350350
}
351351
else
352352
{
@@ -362,7 +362,7 @@ class BitSetOps</*BitSetType*/ BitSetShortLongRep,
362362
{
363363
if (IsShort(env))
364364
{
365-
(size_t&)in = (size_t)use | ((size_t)out & ~(size_t)def);
365+
in = (BitSetShortLongRep)((size_t)use | ((size_t)out & ~(size_t)def));
366366
}
367367
else
368368
{

0 commit comments

Comments
 (0)