Skip to content

Infinite loop in swift-mode:syntax-propertize:scan #192

@haji-ali

Description

@haji-ali

I am constantly running into an issue where Emacs completely freezes when using swift-mode. I am not sure what the reasons are, or how to reproduce it consistently, as it seems to be somewhat random while I edit swift files. However, I've identified where it is happening.

In the function swift-mode:syntax-propertize:scan, this part

((memq (char-after) '(?/ ?*))
(goto-char start)
(forward-comment 1)
(put-text-property start (point) 'swift-mode:comment t))

Moves the point back to the start of the match, then the function (forward-comment 1) is called, expecting the point to move to the end of the comment. For whatever reason, the point doesn't actually move, so that (point) is equal to start, resulting in an infinite loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions