Properly generate either an invoke or a call depending on if we are inside a try block or not.