| Index: runtime/vm/weak_code.cc
 | 
| diff --git a/runtime/vm/weak_code.cc b/runtime/vm/weak_code.cc
 | 
| index 85e623afb9c1b7d138e40c017bb8244be728275f..3177ba63f90ebb6cd97653a801646fc9ff919cbb 100644
 | 
| --- a/runtime/vm/weak_code.cc
 | 
| +++ b/runtime/vm/weak_code.cc
 | 
| @@ -117,15 +117,15 @@ void WeakCodeReferences::DisableCode() {
 | 
|        // Invalidate the old code object so existing references to it
 | 
|        // (from optimized code) will fail when invoked.
 | 
|        if (!CodePatcher::IsEntryPatched(code)) {
 | 
| -        CodePatcher::PatchEntry(
 | 
| -            code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
 | 
| +        CodePatcher::PatchEntry(code);
 | 
|        }
 | 
|      } else {
 | 
|        // Make non-OSR code non-entrant.
 | 
| -      if (!CodePatcher::IsEntryPatched(code)) {
 | 
| -        ReportSwitchingCode(code);
 | 
| -        CodePatcher::PatchEntry(
 | 
| -            code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
 | 
| +      if (code.GetEntryPatchPc() != 0) {
 | 
| +        if (!CodePatcher::IsEntryPatched(code)) {
 | 
| +          ReportSwitchingCode(code);
 | 
| +          CodePatcher::PatchEntry(code);
 | 
| +        }
 | 
|        }
 | 
|      }
 | 
|    }
 | 
| 
 |