This is a minimal example reduced from joaotavora/yasnippet#687.
In a git checkout of lates master (5d58314) emacs -Q -L . -l haskell-autoloads -l synprop-bug.el causes an infinite loop. After hitting C-g, *Messages* contains Error during redisplay: (internal--syntax-propertize 6) signaled (quit). synprop-bug.el contains:
(switch-to-buffer "hh")
(haskell-mode)
(erase-buffer)
(insert "{-# foo #-}")
(with-syntax-table (standard-syntax-table)
(scan-sexps 5 1))
This doesn't happen in Emacs 24.5, so it may be a bug in Emacs.