Ticket #124 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

preprocessor does not cull symbols in expressions when possible

Reported by: vapier@gentoo.org Assigned to:
Priority: P1 Milestone:
Component: Preprocessor: NASM-compatible Version: 0.6.0
Severity: normal Keywords:
Cc:

Description

i came across a package doing this:

extern RW
%define RW.thm (RW + 22032)
%define RW.en  (RW + 23056)
segment .text
movd [eax + RW.thm - RW.en], mm2

in theory, this value is calculable ... even though RW is an undefined external symbol, its value will be static which means you should be able to do (RW - RW) and get 0. or in this case, the break down is arithmetically obvious:

.. = RW.thm - RW.en
.. = (RW + 22032) - (RW + 23056)
.. = 22032 - 23056
.. = -1024

Attachments

Change History

12/03/07 21:58:55 changed by peter

  • status changed from new to closed.
  • resolution set to fixed.

(In [2018]) Fix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself). This could particularly cause false errors if sym is external.


Add/Change #124 (preprocessor does not cull symbols in expressions when possible)