tcc.patch 873 B

12345678910111213141516171819202122232425
  1. --- ./tcc-0.9.27/tccgen.c 2017-12-17 15:27:05.000000000 +0700
  2. +++ ./tcc-0.9.27-patched/tccgen.c 2022-06-10 23:53:17.869447393 +0700
  3. @@ -18,6 +18,7 @@
  4. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  5. */
  6. +#include <assert.h>
  7. #include "tcc.h"
  8. /********************************************************/
  9. @@ -5115,8 +5116,13 @@
  10. } else if (tok == '.' || tok == TOK_ARROW || tok == TOK_CDOUBLE) {
  11. int qualifiers;
  12. /* field */
  13. - if (tok == TOK_ARROW)
  14. + if (tok == TOK_ARROW) {
  15. indir();
  16. + } else if (tok == '.') {
  17. + if ((vtop->type.t & VT_BTYPE) == VT_PTR) {
  18. + indir();
  19. + }
  20. + }
  21. qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE);
  22. test_lvalue();
  23. gaddrof();