Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 CID-1364351: Fix uninitialized warnings.
details: https://anonhg.NetBSD.org/src/rev/1852adb56024
branches: trunk
changeset: 358893:1852adb56024
user: christos <christos%NetBSD.org@localhost>
date: Sun Jan 21 16:51:14 2018 +0000
description:
CID-1364351: Fix uninitialized warnings.
diffstat:
sys/arch/amd64/amd64/db_disasm.c | 37 +++++++++++++++++++++++++------------
1 files changed, 25 insertions(+), 12 deletions(-)
diffs (62 lines):
diff -r dae3164cd729 -r 1852adb56024 sys/arch/amd64/amd64/db_disasm.c
--- a/sys/arch/amd64/amd64/db_disasm.c Sun Jan 21 16:38:25 2018 +0000
+++ b/sys/arch/amd64/amd64/db_disasm.c Sun Jan 21 16:51:14 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.23 2016/03/25 10:14:43 shm Exp $ */
+/* $NetBSD: db_disasm.c,v 1.24 2018/01/21 16:51:14 christos Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.23 2016/03/25 10:14:43 shm Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.24 2018/01/21 16:51:14 christos Exp $");
#ifndef _KERNEL
#include <sys/types.h>
@@ -1376,20 +1376,33 @@
switch (i_mode & 0xFF) {
case E:
- db_print_address(seg, rex, size, &address);
- break;
case Eind:
- db_printf("*");
- db_print_address(seg, rex, size, &address);
- break;
case Ed:
- db_print_address(seg, rex, LONG, &address);
- break;
case Ew:
- db_print_address(seg, rex, WORD, &address);
- break;
case Eb:
- db_print_address(seg, rex, BYTE, &address);
+ if (!ip->i_has_modrm) {
+ db_printf("Bad address mode %#x without modrm",
+ i_mode);
+ break;
+ }
+ switch (i_mode & 0xFF) {
+ case E:
+ db_print_address(seg, rex, size, &address);
+ break;
+ case Eind:
+ db_printf("*");
+ db_print_address(seg, rex, size, &address);
+ break;
+ case Ed:
+ db_print_address(seg, rex, LONG, &address);
+ break;
+ case Ew:
+ db_print_address(seg, rex, WORD, &address);
+ break;
+ case Eb:
+ db_print_address(seg, rex, BYTE, &address);
+ break;
+ }
break;
case R: {
int ext = ((rex & REX_R) != 0);
Home |
Main Index |
Thread Index |
Old Index