Skip to content

Commit

Permalink
avoid using uninitialized HLL-mapped strings in startup
Browse files Browse the repository at this point in the history
Signed-off-by: Coke <will@coleda.com>
  • Loading branch information
plobsing authored and coke committed Jun 2, 2010
1 parent 7474750 commit bb6b58e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions runtime/tcllib.pir
Expand Up @@ -17,6 +17,14 @@ providing a compreg-compatible method.

.HLL '_tcl'

.macro config_get_intval(reg, val)
# hack to avoid using HLL mapped strings which may not yet be usable
$S0 = config[.val]
$P0 = new ['String']
$P0 = $S0
.reg = $P0
.endm

.sub 'mappings' :anon :load
.local pmc interp
.local pmc core_int, tclint
Expand Down Expand Up @@ -144,15 +152,15 @@ win:
$P1['platform'] = 'windows'
got_platform:
set_root_global ['tcl'], '$tcl_platform', $P1
$I1 = config['bigendian']
.config_get_intval($I0, 'bigendian')
if $I1 goto big_endian
$P1['byteOrder'] = 'littleEndian'
goto done_endian
big_endian:
$P1['byteOrder'] = 'bigEndian'

done_endian:
$I1 = config['intsize']
.config_get_intval($I1, 'intsize')
$P1['wordSize'] = $I1

$S1 = config['osname']
Expand Down

0 comments on commit bb6b58e

Please sign in to comment.