Skip to content

Commit

Permalink
Fixing use before check for null.
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanik committed Dec 6, 2015
1 parent 52f339c commit 81d0376
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/xenia/cpu/frontend/ppc_hir_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ bool PPCHIRBuilder::Emit(GuestFunction* function, uint32_t flags) {
// Stash instruction offset. It's either the SOURCE_OFFSET or the COMMENT.
instr_offset_list_[offset] = first_instr;

// Synchronize the PPC context as required.
// This will ensure all registers are saved to the PPC context before this
// instruction executes.
if (i.type->type & kXEPPCInstrTypeSynchronizeContext) {
ContextBarrier();
}

if (!i.type) {
XELOGE("Invalid instruction %.8llX %.8X", i.address, i.code);
Comment("INVALID!");
Expand All @@ -138,6 +131,13 @@ bool PPCHIRBuilder::Emit(GuestFunction* function, uint32_t flags) {
}
++i.type->translation_count;

// Synchronize the PPC context as required.
// This will ensure all registers are saved to the PPC context before this
// instruction executes.
if (i.type->type & kXEPPCInstrTypeSynchronizeContext) {
ContextBarrier();
}

typedef int (*InstrEmitter)(PPCHIRBuilder& f, InstrData& i);
InstrEmitter emit = (InstrEmitter)i.type->emit;

Expand Down

0 comments on commit 81d0376

Please sign in to comment.