From 205e01fc5020f597ee69643c24fd56268cdf1b50 Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Fri, 21 Jun 2019 14:49:57 -0700 Subject: WorkAround for #25050. (#25316) * WorkAround for #25050. A temporary workaround to push the milestone for this issue to 3.next. * Response review. --- src/jit/emit.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/jit/emit.h b/src/jit/emit.h index 595e2840b5..63d1c7c2bc 100644 --- a/src/jit/emit.h +++ b/src/jit/emit.h @@ -884,6 +884,16 @@ protected: } void idCodeSize(unsigned sz) { + if (sz > 15) + { + // This is a temporary workaround for non-precise instr size + // estimator on XARCH. It often overestimates sizes and can + // return value more than 15 that doesn't fit in 4 bits _idCodeSize. + // If somehow we generate instruction that needs more than 15 bytes we + // will fail on another assert in emit.cpp: noway_assert(id->idCodeSize() >= csz). + // Issue https://github.com/dotnet/coreclr/issues/25050. + sz = 15; + } assert(sz <= 15); // Intel decoder limit. _idCodeSize = sz; assert(sz == _idCodeSize); -- cgit v1.2.3