The resistive wall mode (RWM) instability is numerically investigated for a toroidal resistive plasma, with results compared to those of an analytic cylindrical model. The full toroidal code MARS-F [Liu et al., Phys. Plasmas 7, 3681 (2000)] is applied for a computational study. The results indicate that there are two branches of unstable RWMs, when the toroidal favorable average curvature effect (the GGJ effect) is taken into account in the resistive layer. In addition, the GGJ physics not only directly affects the mode growth rate, but also indirectly modifies the mode stability by changing the continuum damping through modifying the mode frequency in the plasma frame. Furthermore, the plasma resistivity can either stabilize or destabilize the RWM, depending on the regime of key plasma parameters (e.g., the plasma rotation). Similarly, the plasma rotation can stabilize or destabilize the RWM, depending on the plasma resistivity. These numerical results from MARS-F are qualitatively confirmed by an analytic theory model which includes the GGJ effect.