If J-1, SEVIS computer record is very clear and no confusion, but you have 30 days grace period to get rehired.If H-1, if ISO not yet notify USCIS about your termination, and your approval is still not expire, you can get rehired easier.
But the point is, all the above require you REALLY got rehired, to the school administration official knowledge. Your professor is only your supervisor, your school (and ISO) is the one that responsible for your paperwork. And it has to be ISO/School HR(payroll) certify that you are REALLY employed.