Register | Login
Forum Index > Bugs and Fixes > Initalized data size is too large
Author Message
Pages: 1 2
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1719] Initalized data size is too large - posted: 2015-02-17 11:36:07
Code:
byte s1 [] = '123456';
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1729] - posted: 2015-02-18 16:26:03
Seems it similar to this bug:
Code:
program RAW_IMAGE 'test';
#set bits 32;
#set awd true;
const str1 = 'mystr1\x0';
char buf[11] = str1;

Result:
Code:
6D 00 00 00 00 00 00 00 00 00 00

And this:
Code:
program RAW_IMAGE 'test';
#set bits 32;
#set awd true;
const str1 = 'mystr1\x0';
char buf[10] = str1;

EAccessViolation: Access violation
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1741] - posted: 2015-02-19 22:27:22
Fixed for next release, I also found a related bug which was outputting garbled characters in some cases.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1750] - posted: 2015-02-20 19:36:22
Still not fixed:
Code:
byte s1 [] = '123456';

Initalized data size is too large
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1757] - posted: 2015-02-22 16:00:00
Code:
program RAW_IMAGE 'test';

#set bits 32;

#set awd true;
char* str1[2] = ['qwerty\x0', 
                 'asdfgh\x0'];

Compile -- ok, but actually Ziron craches.
Result only this:
Code:
71 77 65 72 61 73 64 66
In ascii:
Code:
qwerasdf
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1769] - posted: 2015-02-23 13:21:54
Initalized data size is too large
Fixed for next release.


Compile -- ok, but actually Ziron craches.


Also fixed for next release.

Regarding the output, it looks correct, char* is 4 bytes each, however this may be a good idea to allow ziron to create an array of pointers to strings, perfect for string tables, so maybe I will update this.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1788] - posted: 2015-02-24 10:50:11
this may be a good idea to allow ziron to create an array of pointers to strings
Yes, this of course good idea smile
Regarding the output, it looks correct
Seems it incorrect. Because if we use 'strings in quotes' then usually pointers to these strings used.

For example:
Code:
function  X(char* str1) {}
X('mystring');
Result:
Code:
00000000  6813000000        push dword 0x13
00000005  E800000000        call dword 0xa
0000000A  55                push ebp
0000000B  8BEC              mov ebp,esp
0000000D  8BE5              mov esp,ebp
0000000F  5D                pop ebp
00000010  C20400            ret 0x4
//.................................
Where Code:
push dword 0x13
really uses address of string. String really at address 0x13.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1789] - posted: 2015-02-24 11:28:20
Yes, this is usually the case for constant strings.

The 2 options are.... when you want to assign a string as characters to a variable you would use ord (regardless of size)....

Or the compiler detects pointer types and creates pointers to the data instead.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 8 user(s) online. 0 member(s) and 8 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd