mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 21:14:35 +03:00
[Bug] Don't crash when formatting label without having an emitter
This commit is contained in:
@@ -123,6 +123,7 @@ Error formatLabel(
|
|||||||
|
|
||||||
DebugUtils::unused(formatFlags);
|
DebugUtils::unused(formatFlags);
|
||||||
|
|
||||||
|
if (emitter && emitter->code()) {
|
||||||
const LabelEntry* le = emitter->code()->labelEntry(labelId);
|
const LabelEntry* le = emitter->code()->labelEntry(labelId);
|
||||||
if (ASMJIT_UNLIKELY(!le))
|
if (ASMJIT_UNLIKELY(!le))
|
||||||
return sb.appendFormat("<InvalidLabel:%u>", labelId);
|
return sb.appendFormat("<InvalidLabel:%u>", labelId);
|
||||||
@@ -146,9 +147,9 @@ Error formatLabel(
|
|||||||
ASMJIT_PROPAGATE(sb.appendFormat("L%u@", labelId));
|
ASMJIT_PROPAGATE(sb.appendFormat("L%u@", labelId));
|
||||||
return sb.append(le->name());
|
return sb.append(le->name());
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return sb.appendFormat("L%u", labelId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return sb.appendFormat("L%u", labelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Error formatRegister(
|
Error formatRegister(
|
||||||
|
|||||||
Reference in New Issue
Block a user