Skip to content

Commit 8ccc834

Browse files
committed
Don't try patching anything if builder is in the error state
Good way to crash/assert fail
1 parent 387bf1d commit 8ccc834

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/compiler/X86Target.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static bool doRegImmShift32(X86Builder &builder, std::optional<Reg32> dst, std::
6363

6464
auto patchCondBranch = [&builder](uint8_t *branchPtr, Condition cond)
6565
{
66-
if(!branchPtr)
66+
if(!branchPtr || builder.getError())
6767
return;
6868

6969
auto off = builder.getPtr() - branchPtr - 2;
@@ -74,7 +74,7 @@ static bool doRegImmShift32(X86Builder &builder, std::optional<Reg32> dst, std::
7474

7575
auto patchBranch = [&builder](uint8_t *branchPtr)
7676
{
77-
if(!branchPtr)
77+
if(!branchPtr || builder.getError())
7878
return;
7979

8080
auto off = builder.getPtr() - branchPtr - 2;

0 commit comments

Comments
 (0)