Оберон-клуб «ВЄДАsoft» https://zx.oberon.org/forum/ |
|
Bug in floating point functions https://zx.oberon.org/forum/viewtopic.php?f=90&t=254 |
Страница 1 из 1 |
Автор: | S.Atan [ 17 сен 2015, 18:35 ] |
Заголовок сообщения: | Bug in floating point functions |
Вот такой код работает только для операторов '*' и '-' Код: "OBERON"
На выходе: 1.2e0 <- * <- / 2.2e0 <- + <- - |
Автор: | Zorko [ 19 сен 2015, 17:04 ] |
Заголовок сообщения: | Bug in floating point functions |
Ответ на баг-репорт: Đặng Minh Công писал(а): Thanks. The floating-point is the least used part, so bug is common
After getting used with garbage collection in Oberon/Component Pascal, programming without garbage collection feels so awkward. I am currently reading on Active Oberon garbage collection, which is suitable for multiprocessor systems. |
Автор: | S.Atan [ 23 дек 2016, 02:13 ] | ||
Заголовок сообщения: | Re: Bug in floating point functions | ||
В новой версии тест... Если код в Module2 вот такой Код: "OBERON"
То все работает нормально, но если скрыть процедуру, то компилится без вопросов и ошибок, но не работает. Даже трап не выскакивает Код: "OBERON"
В архиве тест и компилятор...
|
Автор: | Zorko [ 24 дек 2016, 00:13 ] |
Заголовок сообщения: | Re: Bug in floating point functions |
Đặng Minh Công писал(а): Dear Oleg N. Cher, Thanks for the error reporting. Actually, I already encountered this error before and understand why it happened, but didn't document about it yet. In the previous version, the code generated by compiler accessed its global variables by RIP relative addressing, that meant there was no need for changing base register between module boundary, like in ProjectOberon. However, in this version, I switch to the method of N. Wirth, the benefit is that the number of address fixups during compile process is reduced dramatically. However, it also cause the error which S. Atan encountered. The procedure P is not exported, so in its code, there is no loading of RBX, because it assumed that RBX would always point to the base of Module2 when it was called. However, P was exported indirectly by procedure variable TT.P When P was called by Module1, RBX was still pointing to Module1 base, hence the crash happened. For more detail, you can check the code of PROCEDURE Procedure in Generator.mod The moral of this is that adding more "features" or "tweaks" to the products may not be a good thing, because they could interact in an unexpected way (a case of this dialectical statement: the whole is not equal to the sum of its parts). There are two solutions to this error:
I believe solution 2 is less disruptive and more conforming to the spirit of N. Wirth. Anyway, thank you very much for the report of this error. P.S. In Project Oberon, N. Wirth just let the caller load the base register for the callee, and use the module loader to perform fixup, which was a better solution, but we need more code in module loading phase (which was already complex enough, due to the design of Windows) Đặng Minh Công AyaCompiler 0.8b
|
Страница 1 из 1 | Часовой пояс: UTC + 2 часа |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |