Euphoria Ticket #680: Bug in socket type

The current type function for socket in std/socket.e is

public type socket(object o)

if not sequence(o) then return 0 end if

if not length(o) = 2 then return 0 end if

if not atom(o[1]) then return 0 end if

if not atom(o[2]) then return 0 end if

return 1 end type

The second if statement has an error. It should be either

if not (length(o) = 2) then

or

if length(o) != 2 then

In current version the "not" is being applied to the length(o) only, not the whole expression, causing a call like "if socket({}) then" to crash.

Details

Type: Bug Report Severity: Normal Category: Library Routine
Assigned To: mattlewis Status: Fixed Reported Release: 4.0.2
Fixed in SVN #: View VCS: none Milestone: 4.0.3

1. Comment by mattlewis Jun 21, 2011

See: hg:euphoria/rev/5c72e2e652e0

changeset: 4974:5c72e2e652e0 branch: 4.0 user: Matt Lewis date: Tue Jun 21 08:24:58 2011 -0400 files: tests/t_socket.e description:

  • tests for ticket 680

2. Comment by mattlewis Jun 21, 2011

See: hg:euphoria/rev/00f72581ad33

changeset: 4975:00f72581ad33 branch: 4.0 user: Matt Lewis date: Tue Jun 21 08:26:58 2011 -0400 files: docs/release/4.0.3.txt include/std/socket.e description:

  • fixed socket type checking
  • fixes ticket 680

Search



Quick Links

User menu

Not signed in.

Misc Menu