diff -urpN gdb-6.7-orig/gdb/valops.c gdb-6.7/gdb/valops.c --- gdb-6.7-orig/gdb/valops.c 2007-08-23 20:08:46.000000000 +0200 +++ gdb-6.7/gdb/valops.c 2008-03-03 22:05:59.000000000 +0100 @@ -623,10 +623,12 @@ value_assign (struct value *toval, struc struct frame_info *frame; int value_reg; - /* Figure out which frame this is in currently. */ - frame = frame_find_by_id (VALUE_FRAME_ID (toval)); value_reg = VALUE_REGNUM (toval); + if (value_reg < 0) + error (_("Invalid register %d"), value_reg); + /* Figure out which frame this is in currently. */ + frame = frame_find_by_id (VALUE_FRAME_ID (toval)); if (!frame) error (_("Value being assigned to is no longer active."));