From 8ed7f5761ec62707d2f24bfa95973b7822dda895 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Wed, 28 Jul 2021 08:49:10 +0300 Subject: [PATCH] Fix comments in asm with JitDiffableDasm=1 (#56416) * Avoid asserts in DasmDiffable mode * simplify * Make formatter happier * Address feedback --- src/coreclr/jit/emit.cpp | 2 +- src/coreclr/jit/emitxarch.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/emit.cpp b/src/coreclr/jit/emit.cpp index c44cf8aa2cf..36dbf617a70 100644 --- a/src/coreclr/jit/emit.cpp +++ b/src/coreclr/jit/emit.cpp @@ -3936,7 +3936,7 @@ void emitter::emitDispCommentForHandle(size_t handle, GenTreeFlags flag) // NOTE: eGetCPString always returns nullptr on Linux/ARM if (wstr == nullptr) { - printf("%s string handle", commentPrefix); + str = "string handle"; } else { diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index af60794c949..dc55403d6dc 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -8851,6 +8851,7 @@ void emitter::emitDispIns( else { PRINT_CONSTANT: + ssize_t srcVal = val; // Munge any pointers if we want diff-able disassembly if (emitComp->opts.disDiffable) { @@ -8872,8 +8873,7 @@ void emitter::emitDispIns( { // (val < 0) printf("-0x%IX", -val); } - - emitDispCommentForHandle(val, id->idDebugOnlyInfo()->idFlags & GTF_ICON_HDL_MASK); + emitDispCommentForHandle(srcVal, id->idDebugOnlyInfo()->idFlags & GTF_ICON_HDL_MASK); } break; -- 2.34.1