Function: byte-compile-variable-ref

byte-compile-variable-ref is a byte-compiled function defined in bytecomp.el.gz.

Signature

(byte-compile-variable-ref VAR)

Documentation

Generate code to push the value of the variable VAR on the stack.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defun byte-compile-variable-ref (var)
  "Generate code to push the value of the variable VAR on the stack."
  (byte-compile-check-variable var 'reference)
  (let ((lex-binding (assq var byte-compile--lexical-environment)))
    (if lex-binding
	;; VAR is lexically bound
        (byte-compile-stack-ref (cdr lex-binding))
      ;; VAR is dynamically bound
      (byte-compile-free-vars-warn var var)
      (byte-compile-dynamic-variable-op 'byte-varref var))))