Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DamianX opened this issue May 1, 2020 · 0 comments
Labels
Milestone

Comments

@DamianX
Copy link
Contributor

DamianX commented May 1, 2020

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
@SpaceManiac SpaceManiac added the bug label May 1, 2020
@SpaceManiac SpaceManiac added this to the suite v1.5 milestone Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants