Fix bug in SET_FARVAR.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 15:53:22 +0000 (11:53 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 15:53:22 +0000 (11:53 -0400)
The (val) parameter needs to be evaluated before setting the segment.

src/farptr.h

index e142843791c47b304df4d324c76009efedca06bc..4759a08945003f4f8287f3134c49c1d3a90f2c0b 100644 (file)
@@ -69,8 +69,9 @@ extern void __force_link_error__unknown_type();
     SET_SEG(ES, (seg));                         \
     GET_VAR(ES, (var)); })
 #define SET_FARVAR(seg, var, val) do {          \
+        typeof(var) __sfv_val = (val);          \
         SET_SEG(ES, (seg));                     \
-        SET_VAR(ES, (var), val);                \
+        SET_VAR(ES, (var), __sfv_val);          \
     } while (0)
 
 #define PTR_TO_SEG(p) ((((u32)(p)) >> 4) & 0xf000)