diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 14:14:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 14:14:40 -0300 |
commit | c5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f (patch) | |
tree | a1e8a11973681bc207060809a9cb7119abdc22c1 /lobject.h | |
parent | dfebe439db76b5c9fd9b4e3877857e2449c8ad87 (diff) | |
download | lua-c5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f.tar.gz lua-c5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f.tar.bz2 lua-c5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f.zip |
Strings inside Lua are not fully aligned
Removed code to ensure that strings inside Lua (as returned by
'lua_tolstring') always start in fully aligned addresses.
Since version 5.3 the documentation does not ensure that.
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -350,21 +350,13 @@ typedef struct TString { | |||
350 | } TString; | 350 | } TString; |
351 | 351 | ||
352 | 352 | ||
353 | /* | ||
354 | ** Ensures that address after this type is always fully aligned. | ||
355 | */ | ||
356 | typedef union UTString { | ||
357 | LUAI_MAXALIGN; /* ensures maximum alignment for strings */ | ||
358 | TString tsv; | ||
359 | } UTString; | ||
360 | |||
361 | 353 | ||
362 | /* | 354 | /* |
363 | ** Get the actual string (array of bytes) from a 'TString'. | 355 | ** Get the actual string (array of bytes) from a 'TString'. |
364 | ** (Access to 'extra' ensures that value is really a 'TString'.) | 356 | ** (Access to 'extra' ensures that value is really a 'TString'.) |
365 | */ | 357 | */ |
366 | #define getstr(ts) \ | 358 | #define getstr(ts) \ |
367 | check_exp(sizeof((ts)->extra), cast_charp((ts)) + sizeof(UTString)) | 359 | check_exp(sizeof((ts)->extra), cast_charp((ts)) + sizeof(TString)) |
368 | 360 | ||
369 | 361 | ||
370 | /* get the actual string (array of bytes) from a Lua value */ | 362 | /* get the actual string (array of bytes) from a Lua value */ |