fix #8277, missed variable update inside try block

the fix is to propagate isVolatile correctly in codegen

Backport of 39d9c8a