The reg check used rd_wdata of any valid instruction as the value for
register_shadow. However, for instructions that trapped, this value is
invalid. This commit ensures that rd_wdata of trapped instructions is
never used for register_shadow.