View Issue Details

IDProjectCategoryView StatusLast Update
0031631RunnerHTML5Public2020-03-09 16:10
ReporterAliceAssigned ToLuke Brown 
PriorityMediumSeverityB - MajorReproducibility100%
Status ResolvedResolutionWon't Fix 
PlatformHTML5 OSWindowsOS VersionWindows 10
Product Version2.2.5 
Target VersionFixed in Version 
Summary0031631: HTML5: Using buffer_copy causes the project to crash
DescriptionIssue:
On HTML5, running the function buffer_copy returns an error in Console and causes the project to crash.
The buffer copied appears as undefined when inspecting the destination of the copy.
Please note that this does not happen on windows where is possible to copy buffers correctly.

Expected:
It is possible to copy buffers correctly in HTML5.
Steps To Reproduce1-Launch the IDE
2-Import the project attached
3-Run the project in Windows
4-Press [Keypad 1]
5-Observe the data returned in the Output tab
6-Close the runner
7-Run the project in HTML5 (make sure Obfuscating is deactivated in Preferences)
8-Open the developer tools on the browser
9-Navigate to Console
10-Press [Keypad 1]
11-Observe the issue in Console
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In2.2.5.378
2.x Runtime Verified In

Activities

Alice

2020-02-25 14:12

Adminstrator  

buffercopyhtml5.yyz (20,208 bytes)

Luke Brown

2020-03-09 16:10

Developer   ~0065486

The reason this fails is because "thecopiedbuffer" is undefined. This is because the function "buffer_copy" doesn't return a value (see: https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/buffers/buffer_copy.html).

In VM/YYC, functions which dont return anything often set the "return" value as a value of 0 or -1 by default.
In buffer_copy its set to 0, which by coincidence is a valid buffer ID in this project, but is not the id of the buffer containing the copied data, which is actually "thedestbuffer" in this case.

In HTML5, this works exactly the same way, but no default return value is set for functions with no intended return value.