File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -349,9 +349,16 @@ impl Step for VirtAddr {
349
349
350
350
let mut addr = start. 0 . checked_add ( offset) ?;
351
351
352
- // Jump the gap by sign extending the 47th bit.
353
- if addr. get_bits ( 47 ..) == 0x1 {
354
- addr. set_bits ( 47 .., 0x1ffff ) ;
352
+ match addr. get_bits ( 47 ..) {
353
+ 0x1 => {
354
+ // Jump the gap by sign extending the 47th bit.
355
+ addr. set_bits ( 47 .., 0x1ffff ) ;
356
+ }
357
+ 0x2 => {
358
+ // Address overflow
359
+ return None ;
360
+ }
361
+ _ => { }
355
362
}
356
363
357
364
Some ( Self :: new ( addr) )
@@ -365,9 +372,16 @@ impl Step for VirtAddr {
365
372
366
373
let mut addr = start. 0 . checked_sub ( offset) ?;
367
374
368
- // Jump the gap by sign extending the 47th bit.
369
- if addr. get_bits ( 47 ..) == 0x1fffe {
370
- addr. set_bits ( 47 .., 0 ) ;
375
+ match addr. get_bits ( 47 ..) {
376
+ 0x1fffe => {
377
+ // Jump the gap by sign extending the 47th bit.
378
+ addr. set_bits ( 47 .., 0 ) ;
379
+ }
380
+ 0x1fffd => {
381
+ // Address underflow
382
+ return None ;
383
+ }
384
+ _ => { }
371
385
}
372
386
373
387
Some ( Self :: new ( addr) )
You can’t perform that action at this time.
0 commit comments