View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0031631||Runner||HTML5||Public||2020-02-25 14:12||2020-03-09 16:10|
|Reporter||Alice||Assigned To||Luke Brown|
|Priority||Medium||Severity||B - Major||Reproducibility||100%|
|Platform||HTML5||OS||Windows||OS Version||Windows 10|
|Target Version||Fixed in Version|
|Summary||0031631: HTML5: Using buffer_copy causes the project to crash|
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.
It is possible to copy buffers correctly in HTML5.
|Steps To Reproduce||1-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
|Tags||No tags attached.|
|1.4 Found In|
|2.x Runtime Found In||220.127.116.118|
|2.x Runtime Verified In|
buffercopyhtml5.yyz (20,208 bytes)
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.