Skip to content

Dreamchecker false positive "if condition is always false" with embedded strings #180

@DamianX

Description

@DamianX

The original piece of code that triggered this was:

if (!"[A.icon]") // Shitty workaround for a BYOND issue.
	var/icon/temp = I
	I = icon()
	I.Insert(temp, dir = SOUTH)

The bug can be demonstrated with:

world/New()
	..()
	something("lol")
	something()
/proc/something(stuff)
	if(!"[stuff]")
		world.log << 1
	else
		world.log << 2

which outputs:

2
1

with dreamchecker complaining:

Analyzing proc bodies...

dmtest.dm, line 6, column 4:
error: if condition is always false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions