Hi De_Trix,
Don't worry, the first protection mechanism will indeed be the use of CPU thermal throttling. In case this would fail to keep your device from reaching unsustainable and potentially dangerously high temperatures (which in normal circumstances, it never should get this far*), the device will instantly shut down and fail to power on for a while, until cooled down to the point that an instant overheat on power on is not possible.
*You might or might have not read about the issue G512LW owners have endured, being that the fans failed to keep running when the laptop screen went off, and when the laptop went into standby mode. I have experienced several instant shutdown events because of exceptional overheating, of which none of them caused any physical and/or mechanical damage.
A one-time event like you have experienced will almost certainly not have caused any harm at all.
Best regards