If you are already I-485 pending,you're legal in the US unless your case is ultimately denied by CIS.