Modify mkopcodeh.tcl so that it can handle "same as" opcodes with values

larger than the total number of opcodes.

FossilOrigin-Name: 1eb56fe0305f0841b14865b7560add3da529b211328f5fa171b9628418a6ed49
This commit is contained in:
dan 2017-07-14 17:50:11 +00:00
parent c9fb27bfa8
commit 0e6b83088f
3 changed files with 25 additions and 17 deletions

View File

@ -1,5 +1,5 @@
C In\sthe\sLSM1\svirtual\stable,\sdequote\sthe\sfilename\sbefore\sopening\sthe\sfile.
D 2017-07-14T15:57:56.539
C Modify\smkopcodeh.tcl\sso\sthat\sit\scan\shandle\s"same\sas"\sopcodes\swith\svalues\nlarger\sthan\sthe\stotal\snumber\sof\sopcodes.
D 2017-07-14T17:50:11.847
F Makefile.in 081e48dfe7f995d57ce1a88ddf4d2917b4349158648a6cd45b42beae30de3a12
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 20850e3e8d4d4791e0531955852d768eb06f24138214870d543abb1a47346fba
@ -1568,7 +1568,7 @@ F tool/mkctimec.tcl dd183b73ae1c28249669741c250525f0407e579a70482371668fd5f130d9
F tool/mkkeywordhash.c 2e852ac0dfdc5af18886dc1ce7e9676d11714ae3df0a282dc7d90b3a0fe2033c
F tool/mkmsvcmin.tcl cbd93f1cfa3a0a9ae56fc958510aa3fc3ac65e29cb111716199e3d0e66eefaa4
F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c
F tool/mkopcodeh.tcl a01d2c1d8a6205b03fc635adf3735b4c523befd3
F tool/mkopcodeh.tcl bb04ab6e5e2000c91e0c69a597e7e36e002320d123e2e1944cb2819181b72ee9
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 2144bc8550a6471a029db262a132d2df4b9e0db61b90398bf64f5b7b3f8d92cd
F tool/mkshellc.tcl 69c38ecd7b74b2b0799a35ce20e1e3998e504d8c99c100ca4b98ae9d8f6279bc
@ -1633,7 +1633,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 7dc5e70ef1faa0b51a04abdfe1ee2f9ea5c2d0f99ea8ef6260b9de02500cf8b2
R 5d5362fe9325134ea6f8a53ad92e5377
U drh
Z 0befee7d6243c1a561fd6eb2d6242e23
P 6ed4ef03ff6f22ae83a14facc48ce594911d7d7b37446436b68af3a822578fae
R c581c8a15e9205be16cfb4dd2842c7f2
U dan
Z 3b2741e009ea85f74a3c5e73aa1e4d08

View File

@ -1 +1 @@
6ed4ef03ff6f22ae83a14facc48ce594911d7d7b37446436b68af3a822578fae
1eb56fe0305f0841b14865b7560add3da529b211328f5fa171b9628418a6ed49

View File

@ -192,11 +192,13 @@ for {set i 0} {$i<$nOp} {incr i} {
set def($cnt) $name
}
}
set max $cnt
for {set i 0} {$i<$nOp} {incr i} {
set max [lindex [lsort -decr -integer [array names used]] 0]
for {set i 0} {$i<=$max} {incr i} {
if {![info exists used($i)]} {
set def($i) "OP_NotUsed_$i"
}
if {$i>$max} {set max $i}
set name $def($i)
puts -nonewline [format {#define %-16s %3d} $name $i]
set com {}
@ -217,18 +219,24 @@ for {set i 0} {$i<$nOp} {incr i} {
puts ""
}
if {$max>255} {
error "More than 255 opcodes - VdbeOp.opcode is of type u8!"
}
# Generate the bitvectors:
#
set bv(0) 0
for {set i 0} {$i<=$max} {incr i} {
set name $def($i)
set x 0
if {$jump($name)} {incr x 1}
if {$in1($name)} {incr x 2}
if {$in2($name)} {incr x 4}
if {$in3($name)} {incr x 8}
if {$out2($name)} {incr x 16}
if {$out3($name)} {incr x 32}
set name $def($i)
if {[string match OP_NotUsed* $name]==0} {
if {$jump($name)} {incr x 1}
if {$in1($name)} {incr x 2}
if {$in2($name)} {incr x 4}
if {$in3($name)} {incr x 8}
if {$out2($name)} {incr x 16}
if {$out3($name)} {incr x 32}
}
set bv($i) $x
}
puts ""