Skip to content

Bug in always-false conditional, impacting compilers with preprocessor #line  #2823

Description

@Joldiges

In src/compiler/c.rs
|| (&slice[1..5] == b"line "))
should be
|| (&slice[1..6] == b"line "))

I think that this is a off-by-one bug.

It's my understanding in rust that the last value is exclusive in the range, and therefore we are comparing if <4-bytes> == <5-bytes> which will never trigger.

This is smacking Tasking Compiler. Not sure on which others

Originally posted by @Joldiges in #1882

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions