fix #7802, bug in macros that mutate their arguments