[aot] Fix a regression introduced by 82c15fa592b23cf466b0683cc3f02f30d7ea8828.