Even if your I-485 has been filed, your priority date has to be past the DOL published date (Visa bulletin) in order for the 485 application to be approved. However, you can legally stay and work indefinitely on EAD and travel on AP as long as the 485 is pending.
http://www.murthy.com/news/UDpdhdtw.html
If a person has already filed the I-485 application when the dates were current, but then the Visa Bulletin date retrogresses to a date before the priority date, the foreign national would still accrue the benefit of being able to remain in the U.S. with renewable EAD or work authorization and permission to travel, even after completing the six years on H1B status in the U.S. However, the I-485 could not be approved until the date again becomes "current."
http://www.murthy.com/news/UDpdhdtw.html
If a person has already filed the I-485 application when the dates were current, but then the Visa Bulletin date retrogresses to a date before the priority date, the foreign national would still accrue the benefit of being able to remain in the U.S. with renewable EAD or work authorization and permission to travel, even after completing the six years on H1B status in the U.S. However, the I-485 could not be approved until the date again becomes "current."