Skip to content

Tighten string-related code requirements in the GPU fakeshader#93

Open
y5nw wants to merge 2 commits into
mt-mods:masterfrom
y5nw:no-concat
Open

Tighten string-related code requirements in the GPU fakeshader#93
y5nw wants to merge 2 commits into
mt-mods:masterfrom
y5nw:no-concat

Conversation

@y5nw
Copy link
Copy Markdown

@y5nw y5nw commented Apr 19, 2026

First commit: makes the fakeshader GPU command reject string concatenation to avoid issues arising from concatenating long strings (see #85).
Second commit: disallows constructing strings using the single quote (') within the fakeshader command.

Also note that string concatenation can be used to construct certain strings from non-string values (e.g. (1)..(1)).

How to test: use the following Luacontroller code and observe that the GPU rejects the fakeshader code.

if event.type ~= "program" then return end

digiline_send("gpu", {
  {command="createbuffer", buffer=0, xsize=16, ysize=16, fill="000000"},
  {command="fakeshader", buffer=0, code=[[
return ((99)..9):byte(1,3)
]]},
  {command="send", buffer=0, channel="screen"},
})

@y5nw y5nw changed the title Disallow string concatenations in the GPU fakeshader Disallow string concatenation in the GPU fakeshader Apr 19, 2026
@y5nw y5nw marked this pull request as draft April 19, 2026 20:07
@y5nw y5nw changed the title Disallow string concatenation in the GPU fakeshader Tighten string-related code requirements in the GPU fakeshader Apr 19, 2026
@y5nw y5nw marked this pull request as ready for review April 19, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant