A multireference second-order perturbation theory approach based on the generalized active space self-consistent-field (GASSCF) wave function is presented. Compared with the complete active space (CAS) and restricted active space (RAS) wave functions, GAS wave functions are more flexible and can employ larger active spaces and/or different truncations of the configuration interaction expansion. With GASSCF, one can explore chemical systems that are not affordable with either CASSCF or RASSCF. Perturbation theory to second order on top of GAS wave functions (GASPT2) has been implemented to recover the remaining electron correlation. The method has been benchmarked by computing the chromium dimer ground-state potential energy curve. These calculations show that GASPT2 gives results similar to CASPT2 even with a configuration interaction expansion much smaller than the corresponding CAS expansion.