Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 1273223004: Fix short jump address calculation in x64 disassembler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 77599a75bb2c9fc2ec12d846deee48f60cb7c196..5c94d0c5b4bcee62d69be7aba8e44bff465a8e51 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -3156,8 +3156,16 @@ class CodeInstruction extends Observable {
if (address == 0) {
return;
}
-
- jumpTarget = instructionsByAddressOffset[address - startAddress];
+ var relativeAddress = address - startAddress;
+ if (relativeAddress < 0) {
+ Logger.root.warning('Bad address resolving jump target $relativeAddress');
+ return;
+ }
+ if (relativeAddress >= instructionsByAddressOffset.length) {
+ Logger.root.warning('Bad address resolving jump target $relativeAddress');
+ return;
+ }
+ jumpTarget = instructionsByAddressOffset[relativeAddress];
}
}
« no previous file with comments | « no previous file | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698