busybox-1.13.2-awk.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. diff -urpN busybox-1.13.2/editors/awk.c busybox-1.13.2-awk/editors/awk.c
  2. --- busybox-1.13.2/editors/awk.c 2008-11-09 18:28:21.000000000 +0100
  3. +++ busybox-1.13.2-awk/editors/awk.c 2009-02-26 12:17:05.000000000 +0100
  4. @@ -392,8 +392,12 @@ static const uint16_t PRIMES[] ALIGN2 =
  5. /* Globals. Split in two parts so that first one is addressed
  6. - * with (mostly short) negative offsets */
  7. + * with (mostly short) negative offsets.
  8. + * NB: it's unsafe to put members of type "double"
  9. + * into globals2 (gcc may fail to align them).
  10. + */
  11. struct globals {
  12. + double t_double;
  13. chain beginseq, mainseq, endseq;
  14. chain *seq;
  15. node *break_ptr, *continue_ptr;
  16. @@ -442,16 +446,16 @@ struct globals2 {
  17. tsplitter exec_builtin__tspl;
  18. /* biggest and least used members go last */
  19. - double t_double;
  20. tsplitter fsplitter, rsplitter;
  21. };
  22. #define G1 (ptr_to_globals[-1])
  23. #define G (*(struct globals2 *)ptr_to_globals)
  24. /* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
  25. -/* char G1size[sizeof(G1)]; - 0x6c */
  26. -/* char Gsize[sizeof(G)]; - 0x1cc */
  27. +/*char G1size[sizeof(G1)]; - 0x74 */
  28. +/*char Gsize[sizeof(G)]; - 0x1c4 */
  29. /* Trying to keep most of members accessible with short offsets: */
  30. -/* char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; - 0x90 */
  31. +/*char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; - 0x90 */
  32. +#define t_double (G1.t_double )
  33. #define beginseq (G1.beginseq )
  34. #define mainseq (G1.mainseq )
  35. #define endseq (G1.endseq )
  36. @@ -479,7 +483,6 @@ struct globals2 {
  37. #define t_info (G.t_info )
  38. #define t_tclass (G.t_tclass )
  39. #define t_string (G.t_string )
  40. -#define t_double (G.t_double )
  41. #define t_lineno (G.t_lineno )
  42. #define t_rollback (G.t_rollback )
  43. #define intvar (G.intvar )