ShaderEditor icon indicating copy to clipboard operation
ShaderEditor copied to clipboard

Infinite loop protection

Open sjoerdsein opened this issue 8 years ago • 2 comments

This app appears to have no protection against infinite loops. My device crashed when I accidentally typed:

for (int i; i < x; i = i) { // Was to become i = i + 1
  ...
}

It crashed because it ran the code before I was able to type + 1. Luckily it didn't autosave...

I'm using a OnePlus One with Android 6.0.1 and Cyanogen OS 13.1.2-ZNH2KAS3P0-bacon. App version is 2.4.1.

PS: I know i++ is a thing but I was just experimenting.

sjoerdsein avatar Dec 28 '16 15:12 sjoerdsein

Some protection for infinite loop would be nice, but to help with your experimentation. try using i += n

Should be enough to avoid problems. =)

rafaellago avatar Dec 28 '16 16:12 rafaellago

Good point. Although I think there's no way to actually stop a running (shader) program, we might get some warning from glValidateProgram.

markusfisch avatar Dec 29 '16 16:12 markusfisch