[Mono-list] [PATCH] Literal overflow
Andrew Birkett
adb@tardis.ed.ac.uk
Wed, 26 Jun 2002 13:10:55 +0100 (BST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-851401618-1025093455=:27444
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi,
This patch stops the compiler from bombing out when it tries to parse a
literal which is too big to fit into int/float/whatever. It will now give
an error and continue the compilation using an appropriately typed zero
value in place of the literal.
I've attached the patch, and a tarball containing five new tests which
should go into mcs/errors.
Andrew
- www.tardis.ed.ac.uk/~adb -
---559023410-851401618-1025093455=:27444
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=patch
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GS4.4.33.0206261310550.27444@omega.tardis.ed.ac.uk>
Content-Description: Patch for literal overflow
Content-Disposition: attachment; filename=patch
PyBwYXRjaA0KPyBjbGFzcy9jb3JsaWIvVGVzdC9TdHJlYW1Xcml0ZXJUZXN0
LnRlbXANCj8gZXJyb3JzL2NzMDU5NC0yLmNzDQo/IGVycm9ycy9jczA1OTQt
My5jcw0KPyBlcnJvcnMvY3MwNTk0LmNzDQo/IGVycm9ycy9jczEwMjEtMi5j
cw0KPyBlcnJvcnMvY3MxMDIxLmNzDQpJbmRleDogbWNzL2NzLXRva2VuaXpl
ci5jcw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNTIGZpbGU6IC9tb25v
L21jcy9tY3MvY3MtdG9rZW5pemVyLmNzLHYNCnJldHJpZXZpbmcgcmV2aXNp
b24gMS41NQ0KZGlmZiAtdSAtcjEuNTUgY3MtdG9rZW5pemVyLmNzDQotLS0g
bWNzL2NzLXRva2VuaXplci5jcwkxMyBKdW4gMjAwMiAwMDoxNjowMyAtMDAw
MAkxLjU1DQorKysgbWNzL2NzLXRva2VuaXplci5jcwkyNiB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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIHZhbCA9IDBtOyAgICAgDQ0KKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yX2RldGFpbHMg
PSAiRmxvYXRpbmctcG9pbnQgY29uc3RhbnQgaXMgb3V0c2lkZSB0aGUgcmFu
Z2Ugb2YgdGhlIHR5cGUgJ2RlY2ltYWwnIjsNDQorICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVwb3J0LkVycm9y
KDU5NCwgTG9jYXRpb24sIGVycm9yX2RldGFpbHMpOw0NCisgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0NCisJCQkgICAgICAg
IAlicmVhazsNDQorICAgICAgICAJCQljYXNlIFRva2VuLkxJVEVSQUxfRkxP
QVQ6DQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICB0cnkgew0NCisJICAgICAgICAJCQkgICAgICAgIHZhbCA9IChmbG9hdCkg
U3lzdGVtLkRvdWJsZS5QYXJzZSAocywgc3R5bGVzLCBjc2hhcnBfZm9ybWF0
X2luZm8pOw0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgfSBjYXRjaCAoT3ZlcmZsb3dFeGNlcHRpb24pIHsNDQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFs
ID0gMC4wZjsgICAgIA0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBlcnJvcl9kZXRhaWxzID0gIkZsb2F0aW5n
LXBvaW50IGNvbnN0YW50IGlzIG91dHNpZGUgdGhlIHJhbmdlIG9mIHRoZSB0
eXBlICdmbG9hdCciOw0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBSZXBvcnQuRXJyb3IoNTk0LCBMb2NhdGlv
biwgZXJyb3JfZGV0YWlscyk7DQ0KKyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB9DQ0KKwkJCSAgICAgICAgCWJyZWFrOw0NCisN
DQorICAgICAgICAJCQljYXNlIFRva2VuLkxJVEVSQUxfRE9VQkxFOg0NCisg
ICAgICAgIAkJCWNhc2UgVG9rZW4uTk9ORToNDQorICAgICAgICAJCQkJdCA9
IFRva2VuLkxJVEVSQUxfRE9VQkxFOw0NCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgdHJ5IHsNDQorICAgICAgICAJCQkJICAg
ICAgICB2YWwgPSBTeXN0ZW0uRG91YmxlLlBhcnNlIChzLCBzdHlsZXMsIGNz
aGFycF9mb3JtYXRfaW5mbyk7DQ0KKyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB9IGNhdGNoIChPdmVyZmxvd0V4Y2VwdGlvbikg
ew0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICB2YWwgPSAwLjA7ICAgICANDQorICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JfZGV0YWlscyA9
ICJGbG9hdGluZy1wb2ludCBjb25zdGFudCBpcyBvdXRzaWRlIHRoZSByYW5n
ZSBvZiB0aGUgdHlwZSAnZG91YmxlJyI7DQ0KKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlcG9ydC5FcnJvcig1
OTQsIExvY2F0aW9uLCBlcnJvcl9kZXRhaWxzKTsNDQorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NDQorICAgICAgICAJCQkJ
YnJlYWs7DQ0KKyAgICAgICAJCQl9DQ0KKyAgICAgICAgCQlyZXR1cm4gdDsN
DQogCQl9DQ0KIA0NCiAJCS8vDQ0KQEAgLTY3OSw4ICs2OTgsMTUgQEANCiAN
DQogCQkJCQlzdHJpbmcgcyA9IG51bWJlcl9idWlsZGVyLlRvU3RyaW5nICgp
Ow0NCiANDQotCQkJCQl1bCA9IFN5c3RlbS5VSW50NjQuUGFyc2UgKHMsIE51
bWJlclN0eWxlcy5IZXhOdW1iZXIpOw0NCi0JCQkJCXJldHVybiBpbnRlZ2Vy
X3R5cGVfc3VmZml4ICh1bCwgcGVla0NoYXIgKCkpOw0NCisgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsNDQorCQkJCQkg
ICAgICAgIHVsID0gU3lzdGVtLlVJbnQ2NC5QYXJzZSAocywgTnVtYmVyU3R5
bGVzLkhleE51bWJlcik7DQ0KKwkJCQkJICAgICAgICByZXR1cm4gaW50ZWdl
cl90eXBlX3N1ZmZpeCAodWwsIHBlZWtDaGFyICgpKTsNDQorICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE92ZXJm
bG93RXhjZXB0aW9uKSB7DQ0KKyAgICAgICAgICAgICAgICAJCQkJZXJyb3Jf
ZGV0YWlscyA9ICJJbnRlZ3JhbCBjb25zdGFudCBpcyB0b28gbGFyZ2UiOw0N
CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCVJl
cG9ydC5FcnJvciAoMTAyMSwgTG9jYXRpb24sIGVycm9yX2RldGFpbHMpOw0N
CisJCQkJICAgICAgICAgICAgICAgIHZhbCA9IDB1bDsNDQorCQkJCSAgICAg
ICAgICAgICAgICByZXR1cm4gVG9rZW4uTElURVJBTF9JTlRFR0VSOw0NCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0NCiAJ
CQkJfQ0NCiAJCQkJZGVjaW1hbF9kaWdpdHMgKGMpOw0NCiAJCQkJYyA9IGdl
dENoYXIgKCk7DQ0K
---559023410-851401618-1025093455=:27444
Content-Type: APPLICATION/octet-stream; name="new-tests.tar.gz"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GS4.4.33.0206261310551.27444@omega.tardis.ed.ac.uk>
Content-Description: New files for mcs/errors
Content-Disposition: attachment; filename="new-tests.tar.gz"
H4sIAOCuGT0AA+2Wz2uDMBSAe63g//Bu3Q5t80NN7dh1sMPuu1qNbcCaYtKx
se5/X9TS9bKNDtQy3ocQ5ZkQknwvLzUkjIMpm6Vm1BWUkCgIYAQAAeV1S0UY
Nt8NLGQAIiQRp5EIhQtTKugISGczOmNvbFIBjJJs9eN/xu4zWdo+ptQn87nv
zeeQNsdgCQ+FTqwq19OdVqWFVJduedyLMqD31qhMgt1IqJJyLSHXFdi3nYRJ
JlO1TYpDpverQh7yepSJ7/leWiTGwDO8+95452IqBTegdc2LVhk8Jaq8uW2i
47YvZKsC7oHOiIxr7lzow/fcM/RK/U/ajZ/yYf2nR/8Zdwmg8T+K0P8+uB7/
m06Qn8sf56h/x7Qb36X9v/vvtP+6/wWt/ScsRP/74Hr8P44BWZ0BGKeXscVM
8SdS41yjA9f/9Kv+j1hb/wcc/e+Dk//1MVjCY2nlunIWnptvtYYiqdbyQqPr
DLJxNpPX/FtQ22FpN37Y+58Rfqr/BW/qf0IY+t8HXfuv2tt8wajgCxG7ZsGZ
oPECxUcQBEEQBEEQBEEQBEEQBOmUT1loEGQAKAAA
---559023410-851401618-1025093455=:27444--